populating fields

Qamar

Registered User.
Local time
Today, 15:03
Joined
Jun 28, 2004
Messages
42
I have the following setup

tblContinents, with ContinentID, Continent Fields

tblCountries with CountryID, Country, Continent, PostageRate

tblCustomer with CustomerID, Country, AddFields

Now on my main form where i enter the customers details i would like that as soon as i would enter the Country where he comes from, i would like to display the Continent and PostageRate associated with that country, because since i am already storing those pieces of information in the tblCountries, i do not see the need why i should store them again in the customers table.

I think that i should use two unbound textboxes (1 for continent and 1 for postagerate), and then on the onAfterUpdate event of the Country i will display the data according. However, what is the best method to populate these fields if my approach is fine? Can i achieve that with a DLookup Function?

TU
 
Since you have a country table, I assume it is a combobox to choose the country from.
I would use the Click event on that combobox to populate the others.
How you populate them depends on the type of control they are.
 
thanks for the answer. Yes the country field is a combo box. The others i haven't created the control yet on this form, but i am assuming that they should be two unbound textboxes. My main concern is how can i populate these controls based on the value from country combo box?

TU
 
This solution is based on a query and doesnot include any update events or unbound text boxes
 

Attachments

khawar,

many thanks for your sample ... it does exactly what i was looking for, but please could you tell me how the continent and rate changes automatically as soon as the country is changed, because i noticed that you did not use any events?
 
i told you it is based on a query(query1) as all the tables are already linked so I used all fields required by you in a query and then based the form on that query(query1)
check query1 for more understanding
 
Hi,

I saw the attachment and it is a simple which i was trying to do in one of my databases. However, my only question is: is it possible to achieve the same result without having to convert the country field to a combo box at table level? Otherwise i was getting a type mismatch in the query.

Thanks for any advice
 

Users who are viewing this thread

Back
Top Bottom