Combo Boxes

C

C.C.

I am looking for code that would allow me to make a selection from a drop
down box (combo box) and based on that selection it closes that form and
opens another form based on that selection.
 
P

Paul

Try this in the "AfterUpdate" event...

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FormName"

stLinkCriteria = "[frmID]=" & Me![frmID]
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria

This is what I always use.

- Paul
 
D

Dennis

In the After Update event of the combo box (called cmbFind in my example) try
this.
It also assumes the content selected in the combo box will give a unique
record for the other form.

Application.Echo False
DoCmd.OpenForm "OtherForm"
DoCmd.FindRecord cmbFind.Column(0), acEntire, , acSearchAll, , acAll, True
DoCmd.Close acForm, "ThisForm", acSaveNo
Application.Echo True
 
Top