Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box as Driver

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
Is there an easy way to make the selection in a combobox the driver vs. the record selector? I need to be able to edit the other fields/textboxes on the form so making them bound to the combo is a problem.

Thanks and have a great day..Russ
 
Hi,

on the CLICK event of the combobox change the RECORD SOURCE of the form with the criteria equal to the combobox selected item.

hope it helps! Salvatore Grassagliata
GrassagliataS@hotmail.com
 
Hi,

Can you help me with specific syntax? I think I know where your going but I'm not sure.

Thanks..Russ
 
Hi,

Something like this

me.recordsource = "SELECT * FROM table WHERE pk =" & me.combobox

It should requery the form automatically.

Hope it helps you more.

Salvatore Grassagliata
GrassagliataS@hotmail.com
 
Rick,

This is really close. When I select a name from the combobox I get a dialog box that says "please select a parameter value" I type in the name and everything fills correctly. What did I miss?

Thanks..Russ
 
Hi,

To me it should be working.
try :
"SELECT * FROM table
WHERE pk = [Forms]![FormName].[ComboBoxName]"

Hope this does.
Salvatore Grassagliata
GrassagliataS@hotmail.com
 
no luck. What is the closet so far is what you had in the beggining:

Me.RecordSource = "Select * from TableSave where EmpLastName =" & _
Me.Combo55.Value & ";"

Thanks..Russ
 
Hi,

Just wondering... Is your form linked to a query?
if it is, maybe there's a parameter in this query... so that causes the error. Let me know! Salvatore Grassagliata
GrassagliataS@hotmail.com
 
Good thought but I'm building the recordsource in the code based on the combobox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top