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
Printable View
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
Use :
VB Code:
[i]RecordsetName[/i]![i]FieldName[/i] & ""
And it will just use an empty string
:)
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.Quote:
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
#2 - If you append "" to the end, you don't need to check if it is Null, it will work regardless.
:)
Thanks, that worked!