I need a combo box to fill text boxes.

voidcranium

Registered Something.
Local time
Today, 13:21
Joined
Oct 29, 2006
Messages
175
Hello I hope someone can help me on this one.
This is something I am not getting an understanding on and need some help.

I made a form that holds all information for our customers.
I want to make the Company Name box into a combo box so when I change the
Company Name in the combo box it populates all the text boxes on the form with
the correct data.

I for the life of me do not know where/how to even start to do this.

I would attach my database but I cant seem to get the file small enough. I have deleted the large table and it is still 7megs. How do I get it small enough to attach it?

Thanks for the help.
 
Look at "DemoComboBA2000.mdb" (attachment).
Look at Table1, Table2, Form1, Form2.
I think it can help you.
 

Attachments

this is quite simple and their are many sample d/b on this
what you need to look at is the after update propertries on the combo box
and also the row source

the row source should have all the fields you wish to pop ulate
the first being company then add1, add2 add3 postcode or zip whatever

then on you after update hit the ... option and go ito code
and have the fields on your form = the combo.column count
hint Access counts from 0 not from one so everything will be out by 1
when you start just do 1 field say the first line of address and if this fits into the right place then all's tick-er-tee boo otherwise change it by 1 see where it lands , also chuck in a save option at the end to be safe

I copied this from one of my combos

Private Sub Combo48_AfterUpdate()

lettername = Combo48.Column(1)
Paraheading1 = Combo48.Column(2)
Para1 = Combo48.Column(3)
Paraheading2 = Combo48.Column(4)
Para2 = Combo48.Column(5)
Paraheading3 = Combo48.Column(6)
 
Thanks for your replies that is some useful information I will use.
BUT....I noticed that you are pulling the data from the table, I read somewhere that one should never populate a form straight from a table but use a query to get the data and then populate the form.
Thats what I was trying to do, your way seems a lot easier.

Thanks again for the info, I will do it the way you showed me.
 

Users who are viewing this thread

Back
Top Bottom