Error Message

DBL

Registered User.
Local time
Today, 23:20
Joined
Feb 20, 2002
Messages
659
On the on exit event of a combo box in a continuous subform I have the following:

If IsNull(Me.cboSelectClient) Or Me.cboSelectClient = 0 Then
Forms![frmanimalinfo]![AName].SetFocus
'End If
End If

so that if the combo box is empty, it bounces back to the main form. However when I go to a new record (through a command button) I get:

Error 2424: the expression you have entered has a field, control, or property name that Database can't find. It's choking on If IsNull(Me.cboSelectClient) Or Me.cboSelectClient = 0 Then

Any ideas why?
 
Try;

If IsNull(Me!cboSelectClient) etc

Use an exclamation when referencing the value in a control as opposed to a full stop which you use when referencing the Property of a control(I think)
 
Thanks JimBob but that's still giving me the same error message. I'm now using error handling to ignore that error and everything seems to be working but I'm not happy with this solution. Can't understand why it's giving me this.
 
"Forms![frmanimalinfo]![AName].SetFocus"

try

Forms!frmManinamInfo.Form!AName.setfocus
 

Users who are viewing this thread

Back
Top Bottom