Reset controls in subform

essence

Registered User.
Local time
Today, 06:25
Joined
Nov 20, 2006
Messages
21
This thread is a follow-up that relates to the system of the my last. I have a main form with project id and a subform with financial data linked to the main form by project no and p_id. The subform itself has an autonumber primary key field for each transaction. The subform also has the fields Requisition Type (e.g. Purchase Requisition, Payment Voucher....) and I also have the fields PR_No, PV_No...The latter two are set to invisible and only when the user selects a requisition type, does a particular number (eg. PR_No for purchase requisition, PV_No for payment voucher) is displayed. That works ok.
However, I need to be able to reset all controls so that the user can add a new financial record for the same project. Using the navigation bar, and/or a reset button with "DoCmd.RunCommand acCmdRecordsGoToNew" is not functioning as I want. When I click on reset all the data on the screen is cleared, but as soon as I make a selection from the requisition type, all controls reverts to the first record and data for the first record is displayed.

Hopefully, I was not too confusing. My problem is I need to reset/clear the controls on a subform so that I can add a new record. Also, I need that my visible/invisible property of the particular no fields are maintained.
 

Attachments

Your subform is probably linked to your main form one a one-to-one basis causing any subform data to go into the same record.
 
Your subform is probably linked to your main form one a one-to-one basis causing any subform data to go into the same record.
This would be not really a linking in the subform (as those are pretty much set via existing relationships, unless you chose to "choose your own" when it gave you that option), but a symptom of incorrect table design or improper relationships. The relationship of the one record is likely winding up to be, as llkhoutx mentions, a one-to-one relationship, when you believe you want a one-to-many.

If you are using your primary and foreign keys incorrectly then you can very easily wind up with a one-to-one instead of a on-to-many.

I would check your relationships and keys first before anything else.
 

Users who are viewing this thread

Back
Top Bottom