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

HELP!!! Need to know how to capture a result from Query 1

Status
Not open for further replies.

zambrtp

Programmer
Jan 17, 2003
42
US
ANYONE:

I have a combo box that has a row source of ( select DistinctROw column from table ordery by table.column)
That table has two columns the column that is in the row source and a description)

when the user selects the specificed column I want the description to automatically fill another form control ...

I have been able to capture the user's select from the combo box ansd use it in a SQL statment..BUT how do I capture the result of that qry to dump it into the ME.txtDesctiption...?

Thanks
Tereza
 
I think I would do it this way:

1) Include the description column in the row source for the combo box. If you don't want the description to display, set that column's width to 0" in the combo's property sheet, i.e. Column Count = 2, and Column Widths something like 1";0" So now both columns are included in your combo, but only the first column is displayed.

2) Create an event procedure in the After Update event of the combo that looks like this:

Me!txtDescription = Me![cmbMyCombo].Column(1)

HTH...

Ken S.
 
Ken:

Thanks for the help...after is shows up...I need it to go into the database like regular data when the Addrecord button is selected...

Tereza
 
Bind the txtDescription field to the field in your table in which the record is to be saved.

Ken S.
 
Ken..

Sorry I am very new to Access how do I bind the txtField to the table?
Is that a procedure if so when do I do it..After Update, before, on lost Focus
 
Okay, I assume your form is bound to your table. In other words, when you view the properties for the form, the Record Source for the form is your table, right? So, to bind the textbox, view the textbox's properties, and set its Control Source to the corresponding field in your table. Then when you enter data in the textbox, you're also directly entering it into the underlying table.

Ken S.
 
Eupher:

Thanks...I see what I did wrong...I just typed the code into the After update instead of putting in a the CODE...
thanks you had it aswered the first time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top