mrmozambique
Registered User.
- Local time
- Tomorrow, 00:22
- Joined
- May 20, 2009
- Messages
- 16
Hi all. I haven't posted here for a while, but visit regularly. I'm hoping you might have some ideas about an issue I'm having with a subform.
I have a mainform and a continuous subform. The continuous subform has a header with two unbound comboboxes that are used to filter the results in the main detail section. This works fine.
I also have some error handling VBA code in case one of the required fields is left incomplete in the subform. It's pasted below. This code works fine if I try to click on another record in the continuous form. However, when I leave a required field blank and then use one of the header combos, it gives me the normal 3058 error and tries to debug. Why don't these comboboxes in the subform header obey the error handling I've set up?! It's driving me mad.
Thanks in advance for any help.
I have a mainform and a continuous subform. The continuous subform has a header with two unbound comboboxes that are used to filter the results in the main detail section. This works fine.
I also have some error handling VBA code in case one of the required fields is left incomplete in the subform. It's pasted below. This code works fine if I try to click on another record in the continuous form. However, when I leave a required field blank and then use one of the header combos, it gives me the normal 3058 error and tries to debug. Why don't these comboboxes in the subform header obey the error handling I've set up?! It's driving me mad.
Thanks in advance for any help.
Code:
If DataErr = 3058 Then
MsgBox "MAIN ERROR: You are missing one or more required disaggregations in this entry. Please use the dropdowns to select gender, age, etc. If the disaggregation does not apply, be sure to select N/A.", vbExclamation, "Required fields left blank!"
Response = acDataErrCancel
Me.cboother_disag_id.SetFocus
End If