Auto Fill Text Box From Combo Selection

robinsonbst

New member
Local time
Today, 15:48
Joined
Aug 19, 2005
Messages
8
I'm pretty new to this type of programming and i was hoping for a little help,

I have completed the majority of my program it's just a few little things i need to tweak.

The main thing is that i am trying to get a text box to autofill from a selection in a combo box i.e.

i have selected a drop down box with 3 coloums looked up from another table i would like 1 of the columns to stay in the combo box after selection and the other two to appear in the text boxes on the same page.

Any help would be much appreciated.
thanks
Brad
 
Make sure all three fields are in your cboBox. Access starts counting the columns at 0, so if the 2 fields that you want to fill are in column 2 and 3, as you look at the grid, then you could put this in your cboBox AfterUpdate event:

Me.[TextBox1Name] = Me.[ComboBoxName].Column(1)
Me.[TextBox2Name] = Me.[ComboBoxName].Column(2)

HTH,
Shane
 
Tried As is

Thanks Shane

Tried this early this morning but the result i got was was an error saying "The object does not containg an automation object 'me'"

any ideas as to why? i have only tried updating the text box from the number 1 column and this is still the message i get and i think there is an error on syntax for the 2 text boxes.

Thanks
Brad
 
The "Me" might not be applicable in your circumstance. If the autocomplete is in a form, try using the entire reference.. i.e.

Forms![formname]![Textbox1] = Forms![formname]![Combox].Column(1)
 
That particular error usually means the OP put = Me.[ComboBoxName].Column(1) as the Control Source of a text box rather than the code that was suggested in the AfterUpdate event of the ComboBox.
 
Thanks for the help guys but i have tried both solutions changing the information from "Me." to the "Forms!" syntax and then tried this in the after update and also in the control source but still nothing.

I then reverted to using the "Me." and tried this again in the control source but still nothing, any more ideas would be much appreciated.

Thanks
Brad
 
Sorted it cheers guys used the last piece of the original code without the forms section and the control source suggestion

and the working code was simple as it was a loaded form

=[prodidcombo].[column](1)

but any help as to filtering to todays records only. would be grateful.

Thanks
Brad
 

Users who are viewing this thread

Back
Top Bottom