Results 1 to 5 of 5

Thread: 94; Invalid use of Nulls Error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2001
    Location
    Southern California
    Posts
    733

    94; Invalid use of Nulls Error

    I am trying to load a field with data from an MS Access DB and I keep getting this error. How can I avoid this?

    Thanks,
    Jeff

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Use :
    VB Code:
    1. [i]RecordsetName[/i]![i]FieldName[/i] & ""

    And it will just use an empty string

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2001
    Location
    Southern California
    Posts
    733
    I tried that and it's still giving me that error. Here is my code:

    If tblEmployees!emp_Name = Null Then
    cmbName.Text = tblEmployees!emp_Name & ""
    Else
    cmbName.Text = tblEmployees!emp_Name
    End If

    If tblEmployees!emp_dept = Null Then
    cmbDept.Text = tblEmployees!emp_dept & ""
    Else
    cmbDept.Text = tblEmployees!emp_dept
    End If

    If tblEmployees!emp_permissions = Null Then
    cmbPermissions.Text = tblEmployees!emp_permissions & ""
    Else
    cmbPermissions.Text = tblEmployees!emp_permissions

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by jeffo
    I tried that and it's still giving me that error. Here is my code:

    If tblEmployees!emp_Name = Null Then
    cmbName.Text = tblEmployees!emp_Name & ""
    Else
    cmbName.Text = tblEmployees!emp_Name
    End If

    If tblEmployees!emp_dept = Null Then
    cmbDept.Text = tblEmployees!emp_dept & ""
    Else
    cmbDept.Text = tblEmployees!emp_dept
    End If

    If tblEmployees!emp_permissions = Null Then
    cmbPermissions.Text = tblEmployees!emp_permissions & ""
    Else
    cmbPermissions.Text = tblEmployees!emp_permissions
    #1 - To check for Null, you use the IsNull() function.

    #2 - If you append "" to the end, you don't need to check if it is Null, it will work regardless.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2001
    Location
    Southern California
    Posts
    733
    Thanks, that worked!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width