Clear fields on a continuous subform

Lynn_AccessUser

Registered User.
Local time
Today, 17:07
Joined
Feb 4, 2003
Messages
125
I have a continuous subform in which a user picks a value from a combo box (cboField1).

This value filters a list for another combo box (cboField2).

In turn, when the user picks a value from cboField2, three other text fields get populated with data.

Everything works great until a user goes back to a record that already has data and changes the value in cboField1.

cboField2 requeries but if the user forgets to pick a new record from cboField2 then the data in cboField2 and the 3 related text boxes break the business rules for data integrity.

I changed the code on the After Update Event on cboField1 to clear cboField2 and the 3 text boxes. The problem is that it clears all the fields on each record in the subform instead of just the one record.

Any suggestions? Thanks!!!
 
I once had this problem before, i didnt want to struggle with it forever, so i set it up on the click of the save button, that the form would acCmdSaveRecord, then it would close the form, then reopen it. Theres probably better ways like a me.form.refresh then a Me.subform.refresh then requery both, im not sure to test it anymore, but if you want to i would like to see the coding behind and what your actually talking about.

Code i used:
Code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
DoCmd.OpenForm "frmName", acNormal
________
Cbr125Rr
 
Last edited:

Users who are viewing this thread

Back
Top Bottom