cmd button to open selected form from a cbx

Dgavilanes

Registered User.
Local time
Today, 11:38
Joined
Jun 25, 2001
Messages
109
Hi All,
Would like a cmd button to open specific form selected from a combo box.
Any help is appreciated

thanks
Dennis
 
Change the name's to suit; replace x with the correct column number (the first column is 0)

Code:
Private Sub MyButton_Click()
    DoCmd.OpenForm Me.MyCombo.Column(x)
End Sub
 
Thanks it works fine, one final q?

If there is no fmr built yet, I would like to add a message" No form available"

How can I do this

again

thanks a bunch

Dennis
 
  • Set the LimitToList property of the combo to Yes;
  • Code:
    Private Sub MyCombo_NotInList(NewData As String, Response As Integer)
        MsgBox "Form '" & NewData & "' does not exist.", vbExclamation, "No Such Form"
        Response = acDataErrContinue
    End Sub
 
I did exactly as note, but did not work.
Get regular error message "The form name xxxx doest not exist"

reviewing:
I change cbx property to yes, under cbx "not in the list event I placed code"

I might be missing something

Dennis
 

Users who are viewing this thread

Back
Top Bottom