open frms from a cbx selection, and a cmd to current ID (1 Viewer)

Dgavilanes

Registered User.
Local time
Today, 22:41
Joined
Jun 25, 2001
Messages
109
Hi All,
I have a cbx with seven categories which represent 7 separate frms.
I would like to select a value from the cbx and click on a cmd button that will open the selected frm on the current ID.
Any help would be greatly appreciated

thanks

Dennis
 

dcx693

Registered User.
Local time
Today, 17:41
Joined
Apr 30, 2003
Messages
3,265
Assuming:
1- your cbx is named cboSelectForm
2- the desired ID is in a textbox named txtID:
3- the field in the recordsource feeding the form to be opened is called "ID"

Use code like this:
Code:
DoCmd.OpenForm Me.cboSelectForm,,,"[ID]=" & Me.txtID
 

a.sinatra

quik
Local time
Today, 14:41
Joined
Jan 10, 2004
Messages
262
dcx693 said:
Assuming:
1- your cbx is named cboSelectForm
2- the desired ID is in a textbox named txtID:
3- the field in the recordsource feeding the form to be opened is called "ID"

Use code like this:
Code:
DoCmd.OpenForm Me.cboSelectForm,,,"[ID]=" & Me.txtID

You could use this, but what do your naming conventions "look" like, and how is the text displayed in the combo box?

(ex. Naming convention = frmFormName; Text displayed = "Form Name")
________
C-class
 
Last edited:

Dgavilanes

Registered User.
Local time
Today, 22:41
Joined
Jun 25, 2001
Messages
109
dcx693 said:
Assuming:
1- your cbx is named cboSelectForm
2- the desired ID is in a textbox named txtID:
3- the field in the recordsource feeding the form to be opened is called "ID"

Use code like this:
Code:
DoCmd.OpenForm Me.cboSelectForm,,,"[ID]=" & Me.txtID

I used your advise, it worked great

Thanks

Dennis
 

Users who are viewing this thread

Top Bottom