|
-
Jun 4th, 2002, 09:39 PM
#1
Thread Starter
Fanatic Member
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
-
Jun 4th, 2002, 09:46 PM
#2
Use :
VB Code:
[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
-
Jun 4th, 2002, 09:51 PM
#3
Thread Starter
Fanatic Member
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
-
Jun 4th, 2002, 09:53 PM
#4
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
-
Jun 4th, 2002, 10:03 PM
#5
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|