passing values from one form to another form

bibek24

New member
Local time
Today, 05:28
Joined
Sep 26, 2008
Messages
7
Hi all,

I have a main form frmCase which has a comment area section containing a form fsubCaseDetails which is a continious one.
There is a button "Add Comments" in frmCase which on clicking should open a form frmZoom.This form has Save and Cancel button.
On clicking the save button the text entered in the frmZoom should get transferred to fsubCaseDetails.
As fsubCaseDetails is a continious form, clicking the button "Add Comments" for the 2nd time the text from frmZoom should get transferred to 2nd instance of fsubCaseDetails.

I know this can be done by Open Args property of form.But I am new to Access and VB,so please help me with sufficient code and explanation.

Thanks.
 
Why not just set frmZoom to the underlying source for the case details (eg. tblCaseDetails)? Then once OK is clicked, the OnActivate event of frmCase requerys the subform to show the new record that was just added?

-dK

EDIT: I should add that then you wouldn't have to pass using OpenArgs. On frmZoom, have a hidden text box for the foreign key of the primary key of frmCase (guessing CaseID with control name txtCaseID). The hidden textbox data source would be on the foreign key field and the default value would be = Forms!frmCase!txtCaseID. This will ensure you catching the foreign key when you open up frmZoom.
 
Last edited:
Hi dk,

My requirements are very specific as I have explained.I cannot experiment on other things.
Could you please help me as per my requirements.

Thanks,
Bibek
 
That's pretty incredible. You're telling me that a user said that you had to use forms like that with those buttons? Users usually tell me what they want to accomplish. I take the simplest (i.e. least expensive) path to what the customer needs, which almost always means using Access built in functionality.

I like your answer dK, whether the OP does or not.
 

Users who are viewing this thread

Back
Top Bottom