On Not in List Code Not Working

  • Thread starter Thread starter bw
  • Start date Start date
B

bw

The lookup table zVersionPlatform has only one field, which is PVersion.
The Procedure below IS NOT EXECUTED when I try to add a value that is not in
the list.
Can someone give me a hint as to what the problem may be?

Thanks,
Bernie

Private Sub PlatVer_NotInList(NewData As String, Response As Integer)
Dim byt As Byte
byt = MsgBox("Do you want to add this new Version Number to the Lookup
Table?", vbYesNo)
If byt = vbYes Then
Response = acDataErrAdded
CurrentDb.Execute "INSERT INTO zVersionPlatform(PVersion) VALUES( """
& NewData & """);"
End If
End Sub
 
bw said:
The lookup table zVersionPlatform has only one field, which is
PVersion. The Procedure below IS NOT EXECUTED when I try to add a
value that is not in the list.
Can someone give me a hint as to what the problem may be?

Thanks,
Bernie

Private Sub PlatVer_NotInList(NewData As String, Response As Integer)
Dim byt As Byte
byt = MsgBox("Do you want to add this new Version Number to the
Lookup Table?", vbYesNo)
If byt = vbYes Then
Response = acDataErrAdded
CurrentDb.Execute "INSERT INTO zVersionPlatform(PVersion)
VALUES( """ & NewData & """);"
End If
End Sub

Do you have the combo box's LimitToList property set to Yes?
 
Thanks for responding Dirk,

No, the LimitToList property was set to NO, which is what I thought it
should be. I have changed it and it works fine now.

Thanks again,
Bernie
 
Back
Top