Michael J Ross
Registered User.
- Local time
- Today, 08:03
- Joined
- Mar 2, 2006
- Messages
- 245
I have a form with subforms that are set as data Entry.
In one of the sub forms I want to do a check to ensure that data has been entered on the main form thus creating a new record before data can be entered into the subform.
In a combobox before update event I have put code in to see if the new record id which is autonumber has been created.
My code is
If Forms![MainForm]![Id] Is Null Then
MsgBox "You must enter some data on main form first"
Me.ComboMeas.Undo
End If
When I test it I get the message
Run-time error 424
Object required
When I debug it goes to the If line
Does anyone know how I can fix it?
I have tried searching it but found no suitable answer.
Cheers
In one of the sub forms I want to do a check to ensure that data has been entered on the main form thus creating a new record before data can be entered into the subform.
In a combobox before update event I have put code in to see if the new record id which is autonumber has been created.
My code is
If Forms![MainForm]![Id] Is Null Then
MsgBox "You must enter some data on main form first"
Me.ComboMeas.Undo
End If
When I test it I get the message
Run-time error 424
Object required
When I debug it goes to the If line
Does anyone know how I can fix it?
I have tried searching it but found no suitable answer.
Cheers