vegemite
Registered User.
- Local time
- Tomorrow, 03:18
- Joined
- Aug 5, 2019
- Messages
- 64
Hi guys,
I am grabbing some old code and I can see it working in the database I have grabbed it from but having issues with this instance.
Once I enter the value, it prompts not in list as expected, I can add it then it loops back to not on list again. If I select no I don't want to add it I get a runtime error "You entered an expression that has an invalid reference to the property". Strangely when I exit the debug my item is on the list..
Im very much learning & would appreciate if you cant be nice, don't comment about my lack of skills ;-)
FYI the client name is first name and surname
Private Sub txtClientName_NotInList(NewData As String, Response As Integer)
'Enable the user to choose if they want to add a new client
If MsgBox("Client Name is not on list, would you like to add it?", vbOKCancel) = vbOK Then
DoCmd.OpenForm "frmDirectory", acNormal, , , acFormAdd, acDialog, txtOrgNameID & Chr(165) & NewData
'NewData
txtClientName.Recordset.Requery
txtClientName.Text = NewData
End If
'Clear the error and remove the entered data
Response = acDataErrContinue
Me!txtClientName.Undo
End Sub
I am grabbing some old code and I can see it working in the database I have grabbed it from but having issues with this instance.
Once I enter the value, it prompts not in list as expected, I can add it then it loops back to not on list again. If I select no I don't want to add it I get a runtime error "You entered an expression that has an invalid reference to the property". Strangely when I exit the debug my item is on the list..
Im very much learning & would appreciate if you cant be nice, don't comment about my lack of skills ;-)
FYI the client name is first name and surname
Private Sub txtClientName_NotInList(NewData As String, Response As Integer)
'Enable the user to choose if they want to add a new client
If MsgBox("Client Name is not on list, would you like to add it?", vbOKCancel) = vbOK Then
DoCmd.OpenForm "frmDirectory", acNormal, , , acFormAdd, acDialog, txtOrgNameID & Chr(165) & NewData
'NewData
txtClientName.Recordset.Requery
txtClientName.Text = NewData
End If
'Clear the error and remove the entered data
Response = acDataErrContinue
Me!txtClientName.Undo
End Sub