wvandenberg
Technical User
Hello Everyone,
I am having trouble with code for a NotInList event. Here are the details of my form. I have a main form (frmMain) with a tab control (tabMain). On Page1 of tabMain, I have a subform. In the subform I have a bound combo box (cboClient). I am trying to capture the NewData value from cboClient and then pass it to a textbox on Page2 of tabMain so the user can add the rest ot the client details. The code I have so far gives error 2115 'The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing the database from saving the data in the field'. However, there is no BeforeUpdate or ValidationRule set for this field.
Here is part of the code I am using and it's the last line that throws the error.
Can anyone provide any suggestions on how to do this?
Thanks In Advance
Wendy
I am having trouble with code for a NotInList event. Here are the details of my form. I have a main form (frmMain) with a tab control (tabMain). On Page1 of tabMain, I have a subform. In the subform I have a bound combo box (cboClient). I am trying to capture the NewData value from cboClient and then pass it to a textbox on Page2 of tabMain so the user can add the rest ot the client details. The code I have so far gives error 2115 'The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing the database from saving the data in the field'. However, there is no BeforeUpdate or ValidationRule set for this field.
Here is part of the code I am using and it's the last line that throws the error.
Code:
Private Sub fkClientID_NotInList(NewData As String, Response As Integer)
Dim strName As String, strWhere As String
Dim intI As Integer
' User typed in a name that's not in the list
strName = NewData
' Verify that they want to add the new Contact
If vbYes = MsgBox("Client '" & NewData & "' is not defined. " & _
"Do you want to add this Client?", vbYesNo + vbQuestion + vbDefaultButton2, _
gstrAppTitle) Then
Me.Parent.tabMain.Pages("pgeClients").SetFocus
Can anyone provide any suggestions on how to do this?
Thanks In Advance
Wendy