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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch a form by double-clicking on a subform field

Status
Not open for further replies.

rcorbett

Instructor
Nov 25, 2002
24
US
I have a form titled frmApheresisTrima based on a table titled tblTrimaSpectra. Within the Form is a subform titled frmApheresisTrimaSubform. This information is tied into a calendar control – in other words I can click on a date and it will display donors in the subform for that day. What I want to do is this; double-click on the Donor Name and have a more complete form (frmTrimaSpectra) open so that they can then access and finish entering data into it for that selected donor. I have come across some useful information that has me close but is presenting a problem. On the subform field titled DonorName in the Dbl Click Event I created the following Event Procedure:

Private Sub DonorName_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmTrimaSpectra", acNormal, "OrderFilter"
End Sub

From here I created a query based on the recordsource of the of the main form (tblTrimaSpectra). I added the field DonorName and applied the following criteria: Forms![ApheresisTrimaSubform]![DonorName]. From here I opened the query property sheet and set the Output all Fields to Yes. I saved the query as OrderFilter.

Finally to the point! If I go to the subform itself and double click on a certain donor it will launch the frmTrimaSpectra with the donor showing. When I am back to the main form (frmApheresisTrima), which has the subform in it, when I double-click on the donor name it ask for a parameter value – if I type in the persons name it opens the form. I don’t want that – I want to go right to the form. Any suggestions would be greatly appreciated!
 
The criteria should be:
Forms![frmApheresisTrima]![ApheresisTrimaSubform].Form![DonorName]

Have a look here:
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
One method would be to define a public variable (ex: strCurrentDonorName) to hold the value of DonorName. Then, when your open the form from your subform you would include the criteria for the frmTrimaSpectra as something like "[DonorName] ='" & strCurrentDonorName

Bob S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top