Loading a recordset from a combo box

shrive22

Board Regular
Joined
Jun 10, 2002
Messages
120
I have a form that when opened is blank I have a combo box that a user can select a customer number from. THen after they select the cust_No I want to be able to update the recordset for the form based on an sql statement that has the value of the combo box that the user selected in it. Does anyone know how this can be acheived in code?

Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Normaly you would do this by having the form based on a query and use the combobox for the criteria of the query.
There is an example of this in the Northwinds Database that comes with Access.

HTH

Peter
 
Upvote 0
The example that I was thinking of actualy came with the Solutions Database and is the Edit Products form.
The Solutions database came with A97 but I am not sure about latter versions.

HTH

Peter
 
Upvote 0
Can you describe how you make the combo box the criteria for the query? I know how to make a forms recordset based on a query.

Thanks
 
Upvote 0
you refer to the combo box in the query reiteria grid
[Forms]![MyForms]![MyCombo]

and in the ufterupdate of the combo you run a requery to refresh the data to match the combobox

The combobox is an unbound field

HTh

Peter
 
Upvote 0
When I put the forms!docsdue!cust_name in the criteria then view the query it asks me for the parameter value??


For the requery Im not exactly sure how you do that?



Thanks
 
Upvote 0

Forum statistics

Threads
1,221,558
Messages
6,160,484
Members
451,651
Latest member
Penapensil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top