First off, go into Table Design View and delete the 0 from the Default Value for the Field named referred. Best to do this by hi-lighting it and hitting Delete.
If I understand your question correctly, use this code in the Form’s Code Module
Code:
Private Sub Form_Current()
Dim LN As String
Dim FN As String
If Not Me.NewRecord Then
LN = DLookup("lname", "customer", "customer_ID = " & Me.Combo7)
FN = DLookup("fname", "customer", "customer_ID = " & Me.Combo7)
Me.Text9 = LN & " " & FN
Else
Me.Text9 = Null
End If
End Sub
If you want the referrer's name to appear immediately after selecting the ID from the Combobox, use this:
Code:
Private Sub Combo7_AfterUpdate()
Dim LN As String
Dim FN As String
LN = DLookup("lname", "customer", "customer_ID = " & Me.Combo7)
FN = DLookup("fname", "customer", "customer_ID = " & Me.Combo7)
Me.Text9 = LN & " " & FN
End Sub
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007