L
Levans digital
Hi there,
I am having problems with a NotInList event
Below is what I have:
Private Sub ContainerID_NotInList(NewData As String, Response As Integer)
Dim strName As String, strWhere As String
strName = NewData
strWhere = "[ContainerID] = '" & strName & "'"
If vbYes = MsgBox("Container Number " & NewData & " is not defined. " & _
"Do you want to add this Number?", vbYesNo + vbQuestion +
vbDefaultButton2, gstrAppTitle) Then
DoCmd.OpenForm "ContainerNofrm", DataMode:=acFormAdd,
WindowMode:=acDialog, _
OpenArgs:=strName
If IsNull(DLookup("ContainerID", "ContainerNotbl", strWhere)) Then
MsgBox "You failed to add a Container Number that matched what
you entered. Please try again.", vbInformation, gstrAppTitle
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
Else
Response = acDataErrDisplay
End If
End Sub
Aften new data is eneterd into the "ContainerNofrm" and the form is closed I
get error message "Datatype Mismatch in query expression" when I debug the
line below is highlighted:
If IsNull(DLookup("ContainerID", "ContainerNotbl", strWhere)) Then
help
I am having problems with a NotInList event
Below is what I have:
Private Sub ContainerID_NotInList(NewData As String, Response As Integer)
Dim strName As String, strWhere As String
strName = NewData
strWhere = "[ContainerID] = '" & strName & "'"
If vbYes = MsgBox("Container Number " & NewData & " is not defined. " & _
"Do you want to add this Number?", vbYesNo + vbQuestion +
vbDefaultButton2, gstrAppTitle) Then
DoCmd.OpenForm "ContainerNofrm", DataMode:=acFormAdd,
WindowMode:=acDialog, _
OpenArgs:=strName
If IsNull(DLookup("ContainerID", "ContainerNotbl", strWhere)) Then
MsgBox "You failed to add a Container Number that matched what
you entered. Please try again.", vbInformation, gstrAppTitle
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
Else
Response = acDataErrDisplay
End If
End Sub
Aften new data is eneterd into the "ContainerNofrm" and the form is closed I
get error message "Datatype Mismatch in query expression" when I debug the
line below is highlighted:
If IsNull(DLookup("ContainerID", "ContainerNotbl", strWhere)) Then
help