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

Jim Lawrence accessd at shaw.ca
Fri Aug 15 12:35:43 CDT 2008


Hi Susan:

Could it be as simple as:

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

Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Klos, Susan
Sent: Friday, August 15, 2008 9:57 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Populate an unbound form using a record from a table

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

Senior Database Analyst

Florida Department of Education

Evaluation and Reporting Office

Phone: 850.245.0708

email: susan.klos at fldoe.org <mailto:susan.klos at fldoe.org>
 

Please take a few minutes to provide feedback on the quality of service you
received from our staff. The Department of Education values your feedback as
a customer. Commissioner of Education Dr. Eric J. Smith is committed to
continuously assessing and improving the level and quality of services
provided to you.Simply use the link below.  Thank you in advance for
completing the survey.
 

http://data.fldoe.org/cs/default.cfm?staff=Susan.Klos@fldoe.org|12:57:19%20F
ri%2015%20Aug%202008
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list