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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double duty Combo box ? 1

Status
Not open for further replies.

cbalser

Programmer
Dec 28, 2007
7
US
Is is possible to have a combo box on a form that shows the value saved in the table matching the selected record, as well as providing the other possible values in that table in the drop-down for changing the selection for that record? I have a multi-table form and would like to be able to view the current value as well as update this table via the combo box.

I am using recordsets, sql and vba, not Access wizards. Can you give me steps how to set this up? Thanks!!
 

If the combo box is a bound field, wouldn't it serve the purpose?


Randy
 
I have done all my controls in the form with recordsets and being unbound, since so far I am accessing six different tables. I'm not sure how to add a bound control in the middle of that. I am populating the controls from the recordsets on update from initial search combo box, then after making any changes to any of the textboxes, saving all values to their various tables, all with VBA.
 
Code:
Private Sub Form_Load()
    Me!boxCategory.RowSource = "SELECT PID_Caty, Descr_Caty FROM iCategoryFunction"
    Me!boxCategory.Requery
Can be done as above when form loads, and also revised for user actions.

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
How are ya GKChesterton . . .

Note: Whenever you write to the [blue]RowSource[/blue] of a combobox or listbox ... the control [purple]automatically requeries![/purple] This makes [blue]Me!boxCategory.Requery[/blue] not necessary ... Just a heads up ...

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks AceMan. I'm always on the lookout for ways to spare my users a requery!

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top