SimpDaPimp
07-01-2008, 10:56 AM
If IsNull(DLookup("[Time_Out]", "LSC Student Table", "[ID] = " & ID_SIGNOUT.Value)) ThenThat line of code is generating the error. Im not sure why bc all of the fields in the table are set as Text, but i notice that when i create a maketable query and use "ID_SIGNOUT.Value" it creates the value as a "binary" could that have anything to do with this error? If so could someone please help me out. Much Thanks.
SimpDaPimp
pbaldy
07-01-2008, 12:43 PM
The table needs to be bracketed due to the inadvisable spaces. What is the data type of ID in the table? If text, try
If IsNull(DLookup("[Time_Out]", "[LSC Student Table]", "[ID] = '" & ID_SIGNOUT.Value & "'")) Then
SimpDaPimp
07-02-2008, 06:47 AM
Thanks Much!!!!
SimpDaPimp
SimpDaPimp
07-02-2008, 07:22 AM
I have another question pertaining to this same situation, this time i want the DLOOKUP to use the value from a table as the criteria. I have pasted my code below.
If IsNull(DLookup("[Time_Out]", "[LSC Student Table]", "[ID] = '" & [SignOut_ID].[ID] & "'")) Then
MsgBox "Please Sign In First"
End If
pbaldy
07-02-2008, 07:48 AM
I guess you could use another DLookup to get the value from the table (I assume there's only one record?). You might find it more efficient to open a recordset on an SQL statement that joins the tables together.
SimpDaPimp
07-02-2008, 08:00 AM
I tried to do it using a table (that had only one value) the code in the post above is what i used but its giving me a "Microsoft Office Access can't find the filed '|' referred to in your expression. do you know what could be causing this?
SimpDaPimp
pbaldy
07-02-2008, 08:14 AM
Like I said, you'd have to use a second DLookup to get the value from the second table (one DLookup within the other). I think a recordset would be more efficient though.