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!

Combobox updates.

Status
Not open for further replies.

aliceapraham

Technical User
Apr 9, 2007
38
US
Hi There,
I have a combo box with CompanyName & another txt boxs, Address, City & State. I need to put a code in the Combobox that after update it puts in the addressboxs the proper address. how do i do that?
Thank you
Alice
 
What is the actual code of the RowSource property of the combo ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
it has an sql query code which is :
SELECT [Customers Query].CompanyName, [Customers Query].BillingAddress, [Customers Query].City, [Customers Query].StateOrProvince, [Customers Query].PostalCode FROM [Customers Query];
So what do u think what should i pu in the afterupdate code?
Alice
 
Me![Address textbox] = Me![combobox].Column(1)
Me![City textbox] = Me![combobox].Column(2)
Me![State textbox] = Me![combobox].Column(3)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
well this didn't work it's giving me an error, i don't know why, I also tried renaming the fields that you wrote to:
Me![Address] = Me![combo53].Column(1)
Me![City] = Me![combo53].Column(2)
Me![State] = Me![combo53].Column(3)

As My combobox's name is [combo53] & the txtboxes are [Address], [city], [state] & [zip]. but still gave me an error. help please
thank you
alice
 
gave me an error
Any chance you could post some more meaningful info like, say, the error message ?
What is your actual VBA code for the combo53's AfterUpdate event procedure ?
Which line of code is highlighted when in debug mode after the error ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok, The error code is 2448.
My After update code is:

Private Sub Combo35_AfterUpdate()
Me![Address] = Me![Combo35].Column(1)
Me![City] = Me![Combo35].Column(2)
Me![State] = Me![Combo35].Column(3)
End Sub

and it highlights the first line: Me![Address] = Me![Combo35].Column(1)
what am i doing wrong here?
Pls be paicent with me casue i don't know how VB works.thanks
alice
 
Can you manually type the whole address in the textbox ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It's ok It worked. I'm gonna post another question in another posting, if u could help there.
Thank you again
Alice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top