open a table/query whose name is specified by user on a form

ivanteo

Registered User.
Local time
Today, 21:24
Joined
Mar 5, 2002
Messages
31
Is it possible to have a command button open a table/query which is defined by the user in a form combo box?
think a code needs to be used, so was wondering if anyone noes this!
thanks for your time!
 
say your combo box is called cboForms, go to the Afterupdate event of cboForms and paste in the following between the Private sub and end sub lines:

Dim strfrm As String
strfrm = Me!cboForms.Value

If IsNull(Me!cboForms) Then
MsgBox "Choose a form first!"
Exit Sub
Else
DoCmd.OpenForm strfrm
End If

See if that does the trick.

PS, Make sure your combo box is bound to the column holding the form name
 
PS, you could modify that to open a table or a form.....
 

Users who are viewing this thread

Back
Top Bottom