I have been building databases for a while, but just simple ones.  I 
have a new one that I have two tables, table1 holds all the customer 
info and table2 holds city, state, and zip.  I started out dumping 
all the info into I had already collected into table2, and created a 
drop down in my form that works quite well.  The problem I have is 
that when I enter someone new, of course the info I need is not in 
table2.  How do I get the new info to update both tables and save it 
for the next time.  I had someone e-mail me this, but holy cow I do 
not understand.

Private Sub Combo0_AfterUpdate()
Const strcProcedureName As String = "Combo0_AfterUpdate"
On Error GoTo err_
Dim combo_value As String
combo_value = Me.Combo0.Value
    
If combo_value <> "" Then
If IsNull(DLookup("[emp]", "table3", "[emp]='" & combo_value & "'")) 
Then
DoCmd.SetWarnings (0)
DoCmd.RunSQL "Insert Into Table3 ([emp]) values('" & combo_value 
& "')"
Me.Combo0.Requery
DoCmd.SetWarnings (-1)
End If
End If
exit_routine:
Exit Sub
err_:
MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf & "Line: " & 
Erl, 0 + 48, strcProcedureName
GoTo exit_routine
End Sub








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to