Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up a form by clicking on a value in a subform

Status
Not open for further replies.

RickSchadt

Technical User
Dec 8, 2009
7
US
I am trying to create a macro that allows a user to click on a specific field in a datasheet view subform, that pops up a new form to allow the user to edit the specific record displayed in the originating sub-form. I have done this in the past using OPENFORM command in a macro and setting the condition Forms![TransferTrackerSubform]![Transfer Number] = Forms![TransferFormEdit]![Transfer Number]
I have done this in the past, but for some reason this time I get a pop up window asking me to fill in the second value Forms![TransferFormEdit]![Transfer Number]. I have tried referencing the underlying query for the subform and the form field and in all cases I get a dialog box asking me for input...if I put the input in it does bring up the pop up form but not with the correct record.
 
I went back and changed the macro to reflect the following condition

[Transfer Number]=[Forms]![TransferTrackerSubform]![Transfer Number] where [Transfer Number] is the field name of the fieldname argument is the name of a field in the underlying table or query of the form you want to open and Forms]![TransferTrackerSubform]![Transfer Number] is the name of the control on the other form that contains the value you want records in the first form to match. Per the help, it still pops up a dialog box but this time if I fill it in, it does open the form with the correct record.
But still does not do it without manual intervention
 
I would do this with code. If you use the command button wizard, you have the option to open the form based on a value from the current form. Once the wizard is complete, you can copy the code and paste it into the click or double-click event code for the control.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top