[AccessD] Populate an unbound form using a record from a table

Gustav Brock Gustav at cactus.dk
Fri Aug 15 14:34:09 CDT 2008


Hi Susan

You can do this. Use IsNull:

If IsNull(COSCH) Then

/gustav

>>> Susan.Klos at fldoe.org 15-08-2008 18:57 >>>
I am trying to populate some of the text boxes on an unbound form from a
table using the value of another text box on the form which I have
filled in.   Here is my code:

Private Sub AutoFill_Click()

 

If COSCH = Null Then

MsgBox "You must fill in the 'F' school 6 digit district and school
number.", vbInformation, "NOTE"

Exit Sub

End If

Me.READGN = DLookup("READGN", "mch", "COSCH =" & Me.COSCH)

 

READGN is a numeric field and COSCH is the ID field on the table.  When
I run the code, I can see that Me.COSCH  = the correct value for the
record I want.

 

This should be pretty straight forward but I keep getting the error
"Data type mismatch in criteria expression".   Any help you can give me
will be greatly appreciated.

 

 

Susan Klos





More information about the AccessD mailing list