New VB User Needs Help 
Author Message
 New VB User Needs Help

I am new to VB (having to pick it up from the books, with no other
knowledgeable users in our area).  Currently I am working on an
application using VB 4.0 w/ Microsoft Access 2.0 These are
probably dumb questions, but I'm new to this so bear with me.

1.  I need to read a value from a Novell Netware Environment variable.
    How can I do this in VB?  

2.  I am using the following code to load the text boxes on a form
    with data from a record,  I receive  a run time error which says
    "Invalid Use Of Null" whenever one of the fields is empty
    (Happens in this particular instance at the * line).  How do I
    get around this?

    Txt_CaseNo.Text = CaseTable.Fields("Hl_CaseNo").Value
    Txt_Creator.Text = CaseTable.Fields("Hl_Creator").Value
    Txt_CloseDt.Text = CaseTable.Fields("Hl_CloseDt").Value
    Txt_AssnDt.Text = CaseTable.Fields("Hl_CaseNo").Value
    Txt_RsltCode.Text = CaseTable.Fields("Hl_Result").Value
    Txt_CartsCode.Text = CaseTable.Fields("Hl_CartCd").Value
    Txt_CartsSignDt.Text = CaseTable.Fields("Hl_CSignDt").Value

*    Txt_RefCode.Text = CaseTable.Fields("Hl_RefCd").Value  

3.  One particular field has a number of valid options which the user
    may choose from.  The list of available options is stored in an
    Access Database.  I created a Combo Box which is bound to a
    data control.      I set the database property of my data control
    to point to my database, the recordsource property points to my  
    table,  recordset property is set to 0 - table,  connect property is set
    to Access.  On my Combo Box, the datasource property points to
    my data control,  and the datafield property points to the table field
    that contains the selections for the combo box,  style property = 0
    (Dropdown combo).

    When I run the screen, the combo box displays the first record in the
    text box, and the drop down list is empty. (The database has about
    20 - 30 possible selections in it).   Have I forgotten to set a
    critical property?  Do I have to scan the database and add each
    item into the list using additem?  What am I doing wrong?  


Thanks in advance for any help that you may supply.

Bill



Tue, 14 Dec 1999 03:00:00 GMT
 New VB User Needs Help


Quote:
>1.  I need to read a value from a Novell Netware Environment variable.
>    How can I do this in VB?=20

USER$=3DEnviron$("USERID")

Quote:
>2.  I am using the following code to load the text boxes on a form
>    with data from a record,  I receive  a run time error which says
>    "Invalid Use Of Null" whenever one of the fields is empty
>    (Happens in this particular instance at the * line).  How do I
>    get around this?

>    Txt_CaseNo.Text =3D CaseTable.Fields("Hl_CaseNo").Value
>    Txt_Creator.Text =3D CaseTable.Fields("Hl_Creator").Value
>    Txt_CloseDt.Text =3D CaseTable.Fields("Hl_CloseDt").Value
>    Txt_AssnDt.Text =3D CaseTable.Fields("Hl_CaseNo").Value
>    Txt_RsltCode.Text =3D CaseTable.Fields("Hl_Result").Value
>    Txt_CartsCode.Text =3D CaseTable.Fields("Hl_CartCd").Value
>    Txt_CartsSignDt.Text =3D CaseTable.Fields("Hl_CSignDt").Value
>=20
>*    Txt_RefCode.Text =3D CaseTable.Fields("Hl_RefCd").Value =20

Txt_RefCode.Text =3D =
iif(isnull(CaseTable.Fields("Hl_RefCd").Value),"",CaseTable.Fields("Hl_Re=
fCd").Value)

Quote:
>3.  One particular field has a number of valid options which the user
>    may choose from.  The list of available options is stored in an
>    Access Database.  I created a Combo Box which is bound to a
>    data control.      I set the database property of my data control
>    to point to my database, the recordsource property points to my=20
>    table,  recordset property is set to 0 - table,  connect property =
is set
>    to Access.  On my Combo Box, the datasource property points to
>    my data control,  and the datafield property points to the table =
field
>    that contains the selections for the combo box,  style property =3D =
0
>    (Dropdown combo).

>    When I run the screen, the combo box displays the first record in =
the
>    text box, and the drop down list is empty. (The database has about
>    20 - 30 possible selections in it).   Have I forgotten to set a
>    critical property?  Do I have to scan the database and add each
>    item into the list using additem?  What am I doing wrong?=20

Yes, you must load the combobox by looping throught the recordset and =
using AddItem.
OR you can use the dbcombobox which allows you to set the rowsource of =
the combo as a recordset.

David W. Forest
LAN Specialist
Information Technologies
Lear Corporation - Ford Division
SBN Level 2
http://www.concentric.net/~dforest/

If you're not scared, you don't understand.



Fri, 17 Dec 1999 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. New VB user - need some good code samples to study

2. New VB User Help with Access relationships

3. New VB 5.0 / SQL Server User - Please Help

4. Help New VB 5.0 / SQL Server 6.5 User Connect - Please

5. Help for a new VB user!!!

6. Sql Query for new users in the system.....Help Needed

7. New Visual Dbase User Needs Help

8. new user needs help with lookup tables

9. new user needs help

10. New User needs help manipulating phone number field

11. New User Needs Help


 
Powered by phpBB® Forum Software