Pete Morris
Registered User.
- Local time
- Today, 14:10
- Joined
- Mar 31, 2003
- Messages
- 38
as you can probably tell, I'm new to this. The code has run through me several times, with me getting closer to the solution??
Can anybody tell me what is wrong with this as I am getting syntax error at the dlookup customer section.
Private Sub customer_notinlist(newdata As String, _
response As Integer)
Dim strcustomer As String
Dim intReturn As Integer
strcustomer = newdata
intReturn = MsgBox("Customer is not on the list." & _
"Do you want to add this Customer?", _
vbQuestion + vbYesNo, "Changes")
If intReturn = vbYes Then
DoCmd.OpenForm FormName:="Customer Lookup", _
DataMode:=acAdd, _
Windowmode:=acDialog, _
OpenArgs:=strcustomer
If IsNull(DLookup("Customer", _
"tblCustomer lookup", _
"[Customer]=""")) Then
response = acDataErrContinue
Else
response = acDataErrAdded
End If
Exit Sub
End If
End Sub
greatful for any help.
Thanks, Pete.
Can anybody tell me what is wrong with this as I am getting syntax error at the dlookup customer section.
Private Sub customer_notinlist(newdata As String, _
response As Integer)
Dim strcustomer As String
Dim intReturn As Integer
strcustomer = newdata
intReturn = MsgBox("Customer is not on the list." & _
"Do you want to add this Customer?", _
vbQuestion + vbYesNo, "Changes")
If intReturn = vbYes Then
DoCmd.OpenForm FormName:="Customer Lookup", _
DataMode:=acAdd, _
Windowmode:=acDialog, _
OpenArgs:=strcustomer
If IsNull(DLookup("Customer", _
"tblCustomer lookup", _
"[Customer]=""")) Then
response = acDataErrContinue
Else
response = acDataErrAdded
End If
Exit Sub
End If
End Sub
greatful for any help.
Thanks, Pete.