Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid use of NULL

Status
Not open for further replies.

rozzay

Programmer
Jan 3, 2002
142
US
Hi I am trying to load data into textbox from Microsoft Access in one of my fields they are allowed to have nothing but I can not seem to load the records that have a field that is blank, I receive a message saying:

Run-time error "94"
Invalid use of NULL.

Below is my code:

Private Sub cboDate_Click()
rsLogAccess.Open
If Not rsLogAccess.BOF Then
rsLogAccess.MoveFirst
End If
rsLogAccess.Find "[time] = " & cboDate.Text
If Not rsLogAccess.EOF Then
txtVEDPO.Text = rsLogAccess("edpo")
txtVLoad.Text = rsLogAccess("load")
txtVXMIT.Text = rsLogAccess("ordernet")
txtVIinger.Text = rsLogAccess("iingout")
txtVPOs.Text = rsLogAccess("po")
txtVINVs.Text = rsLogAccess("inv")
txtVComment.Text = rsLogAccess("comment")
End If
txtVMF.Text = rsLogAccess("mf")
txtVProPOs.Text = rsLogAccess("webP_pos")
txtVProVen.Text = rsLogAccess("webP_Ven")
txtVTestPOs.Text = rsLogAccess("webS_Pos")
txtVTestVen.Text = rsLogAccess("webS_ven")
Else
MsgBox "Error unable to load data", vbOKOnly
End If
rsLogAccess.Close
End Sub


thanks
 
Hi

Here is you solution:
simply add a blank string when you assing a recordset field value to a text box or any control

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Private Sub cboDate_Click()
rsLogAccess.Open
If Not rsLogAccess.BOF Then
rsLogAccess.MoveFirst
End If
rsLogAccess.Find "[time] = " & cboDate.Text

If Not rsLogAccess.EOF Then
txtVEDPO.Text = rsLogAccess("edpo") & ""
txtVLoad.Text = rsLogAccess("load") & ""
txtVXMIT.Text = rsLogAccess("ordernet") & ""
txtVIinger.Text = rsLogAccess("iingout") & ""
txtVPOs.Text = rsLogAccess("po") & ""
txtVINVs.Text = rsLogAccess("inv") & ""
txtVComment.Text = rsLogAccess("comment") & ""
End If
txtVMF.Text = rsLogAccess("mf") & ""
txtVProPOs.Text = rsLogAccess("webP_pos") & ""
txtVProVen.Text = rsLogAccess("webP_Ven") & ""
txtVTestPOs.Text = rsLogAccess("webS_Pos") & ""
txtVTestVen.Text = rsLogAccess("webS_ven") & ""
Else
MsgBox "Error unable to load data", vbOKOnly
End If
rsLogAccess.Close
End Sub


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top