Combo Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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
 

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

Back
Top