Autocomplete within a form

janed

Registered User.
Local time
Today, 07:06
Joined
Feb 6, 2002
Messages
60
I have ten fields within a form which are linked to a table "A". The first five fields within this form should work as normal updating themselves to table "A". However i would like the last five to work as follows: If the first two fields of the last five contain data enteries matching data in a table "B" (whch ther can be only one istence of) I want the last three fields in the form to be automatically completed with data from table "B" and are then subsequentely entered in table "A".

Please help me!!!
 
In the After Update event of field 7 something like this should work:

If Not IsNull(DLookup(Look For Match for field 6)) and Not IsNull(DLookup(Look For Match for field 7)) Then
Me![Field8] = DLookup(...)
Me![Field9] = DLookup(...)
Me![Field10] = DLookup(...)
Else
MsgBox "No Matches Found."
End If

You could use more sophisticated code but this should work for you...
 

Users who are viewing this thread

Back
Top Bottom