Automatic Data Entry

chrisyb322

New member
Local time
Today, 06:13
Joined
Jun 20, 2007
Messages
6
Hi there,

I have a table called Cars and a table called Rent

In Cars i have Car ID (Autonumber and primary Key) and Price Per Day

In Rent I have Rent ID, Car ID and Price Per day

The Car ID in Rent is a lookup from the Cars table, but is it possible to make it so that when i enter the Car ID in the Rent table, it automatically fills in the Price per day field for me?

Sorry if something like this has already been posted, i didnt know what this is called so didnt know what to look for.

Thanks
Chris
 
only if it is performed through a form.

if the carID is selected from a combo box you can either place code in the after update event of the combo box to retreive the price, or a simpler solution is the incorporate the price in the query that drives the combo box and set the default value of the price field to column of the combo box that hold the price.
 
The form option sounds best what code would i use
thanks for the help
 
in the price control set the default value to

=me!NameOfYourComboBox.Column(n)

where n is the column that contains the price
 
Sorry i really cant follow what to do,
I dont know how to make it a combo box, because its an autonumber?
Any ideas and im not sure if that code works
What does the me! part represent?

Thanks again
 
me is a shortcut reference to the current form.

I aleays differectiate between a control and a property/method by using

Me!Control

and
me.Method

use the combo wizard to generate a combo box and an action to take.
 

Users who are viewing this thread

Back
Top Bottom