On Open

J

JohnLute

I have a form that I open with a button. The button Event Procedure is:

Private Sub cmdGOrpt_Click()
On Error GoTo Err_cmdGOrpt_Click

Dim stDocName As String

DoCmd.OpenForm "frmQueryFGProcessingFacIDsLineIDs"

Forms!frmQueryFGProcessingFacIDsLineIDs!cbNavigateProfiles = _
Forms!frmFinishedGoods!cbProfileID

DoCmd.OpenForm Me!cbSelectReportRQ, acNormal

Exit_cmdGOrpt_Click:
Exit Sub

Err_cmdGOrpt_Click:
MsgBox Err.Description
Resume Exit_cmdGOrpt_Click

End Sub

This works but I need to change things. I now need the button to open the
form as well as others that will be queried in the combo box:

cbSelectReportRQ

How can I code the button to open up forms as well as open the above form to
the desired record?

WHEW!

Thanks!
 
K

K

Go to macros in the DBase design window. Create new. Select open form in the
action then complete the rest of the information in the bottom of the window.
Creat a new button pon the form and have it run the macro. You can have the
macro open has many forms as you want or run queries.
 
J

JohnLute

That seems simple enough. I've just explored that and it may be a possible
solution however my current design uses a combo box cbSelectReportRQ to query
a lookup table. I really don't want to deviate from this design and re-invent
the wheel.

I really want to keep my current button to open the selection in
cbSelectReportRQ.

Is there something I can do then with frmQueryFGProcessingFacIDsLineIDs to
have it open to the record selected in frmFinishedGoods!cbProfileID?
 
K

K

Sure. You can have a macro run on through varios events. In design view**On
the field (Combo box) right click and go to events tab. Try after update and
select the macro you made.

I strongly suggest that when testing a dbase and make any changes to create
a copy of the original if you havent already done this.

Cheers
 
Top