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

Stuart McLachlan stuart at lexacorp.com.pg
Fri Aug 15 19:24:21 CDT 2008


Null means indeterminate. - nothing can "equal" Null.

Use:  If IsNull(COSCH) Then



On 15 Aug 2008 at 12:57, Klos, Susan wrote:

> 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%20Fri%2015%20Aug%202008
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

-- 
Stuart Mclachlan





More information about the AccessD mailing list