Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AUTO POPULATE FIELD

Status
Not open for further replies.

DantheDbaseMan

Programmer
Mar 16, 2000
11
0
0
US
I have two table as examples below:

DEALER_CODE DATA ENTRY
=========== ==========
DEALER_CODE DEALER_CODE
DEALER_NAME DEALER_NAME
REP_NAME REP_NAME <--Want auto populate with
REP_NAME in DEALER CODE table
when DEALER_NAME combo box
in DATA ENTRY is used.
 
Can you give a little more detailed explanation. I'm not sure what you are trying to do.
 
Try This

Dim varX Variant
varX = DLookup(&quot;[DEALER_NAME]&quot;, &quot;DEALER_CODE Table&quot;, &quot;MeFieldName = [DEALER_CODE ]&quot;)


If IsNull(varX) Then
?Not Found
Else
Me.Field = Varx
End If -------------------------
Regards
JoaoTL
NOSPAM_mail@jtl.co.pt
-------------------------
 
Sorry,

On AfterUpdate() Event

Here you have a problem if the user dont change the data in the field, it not change anything


Or On Lost Focus() Event

Use this if you whant to Update the Field if the user lost is focus

Dim varX Variant
varX = DLookup(&quot;[DEALER_NAME]&quot;, &quot;DEALER_CODE Table&quot;, &quot;MeFieldNameCODE = [DEALER_CODE ]&quot;)


If IsNull(varX) Then
?Not Found
Else
Me.Field = Varx
End If -------------------------
Regards
JoaoTL
NOSPAM_mail@jtl.co.pt
-------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top