open record on one form from another form

J

JohnE

I have a continuous form that has a small button at the end of each record
that takes the user to another form showing the detail of the selected
record. But, the current way that I open the detail form is the following;

DoCmd.OpenForm "frmChangeRequestDetail", acNormal, , "ChangeRequestID =" &
Me.ChangeRequestID

This opens the form in a filtered manner. The detail form has on it a
combobox that is used to select other records from the list. But, when the
small button on the continuous form is used, it renders the combobox on the
detail form useless. Is there a different (and better way) to open the
detail form and have it go to the selected record on the continuous form?

Thanks.
.... John
 
F

fredg

I have a continuous form that has a small button at the end of each record
that takes the user to another form showing the detail of the selected
record. But, the current way that I open the detail form is the following;

DoCmd.OpenForm "frmChangeRequestDetail", acNormal, , "ChangeRequestID =" &
Me.ChangeRequestID

This opens the form in a filtered manner. The detail form has on it a
combobox that is used to select other records from the list. But, when the
small button on the continuous form is used, it renders the combobox on the
detail form useless. Is there a different (and better way) to open the
detail form and have it go to the selected record on the continuous form?

Thanks.
... John

I'm not wholly sure I follow what it is you wish to do, but try this
way. At the very least you can adapt it to work on your forms.
To open the second form (in continuous view), code the first form:

DoCmd.OpenForm "frmChangeRequestDetail", acFormDS, , , , ,
Me.[ChangeRecquestID]

Then code the "frmChangeRequestDetail" Load event:

If Not IsNull(Me.OpenArgs) Then
Me.[ChangeRequestID].SetFocus
DoCmd.FindRecord Me.OpenArgs, , , acSearchAll
End If

Change [ChangeRequestID] to whatever the actual name of the unique
field is on the form is. Also change the form name as needed.
Focus will be on the selected record, but all of the records will be
shown on the form (in continuous view).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top