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

Change value after PropertyChange

Status
Not open for further replies.

Brianfree

Programmer
Feb 6, 2008
220
GB
Hi i have a drop downlist which has Supplier_ID's, when i select an id it populates some textfields with the Supplier Name, however it does not populate the Contact or telephone?

It is part of the query, am i limited to using only Column(0) and Column(1) as i can seem to use Column(2) etc..


This is how i am calling the values..


Me!Supplier_Name = Me![Supplier_ID].Column(0)
Me!Contact = Me![Supplier_ID].Column(1)
Me!Telephone = Me![Supplier_ID].Column(2)

Please can someone help!

Many thanks,

BF
 

Hi BF,

If I don't misunderstand you, the thing you need is a bound form. that means, that each textbox is bound to a specific field from your query. This way, when you change the ID, all the bound controls (=textboxes etc) will automatically display the data of the current ID (without you having to write any code.

Hope this will help you.
Ja
 
Thanks for replying, have you an example for me too look at?

Many thanks,

BF
 
Hi,

It is not any VBA 'code' what I can put you an example. You only have to do the following:

1) Set the Record source of your form (On the Data tab from the form's properties. there you can choose from a drop-down list, a table, a query, or put a 'SQL string').

2) Then you have to set the Control source for every control you want to be bound.

by example: you might have a textbox where you the Supplier_Name[/b] should be displayed [blue](I would name the textbox: txtSupplier_Name - to distinguish between the control name and the field name.)[/blue]. Then you should choose the field - probably named - Supplier_Name as the control source for this textbox. ( As above, On the 'Data' tab there is a drop-down list, what shows all fields available in the form's 'record source'.)
And so on for Contact and Telephone...

3) one more thing: make sure that the 'Data Entry' property of the form, should be set to No (otherwise it is intended for entering new data only, and therefore no other records will be seen)

Got it?
Ja
 
What are the RowSource and ColumnCount properties of Supplier_ID ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top