auto complete

Tech

Registered User.
Local time
Today, 19:38
Joined
Oct 31, 2002
Messages
267
In Access, on a form, when we select lets say a customer ID from a drop down box, is there a way to automatically fill in the fields, like customer name and address based on the ID chosen from the drop down list? if so - how?

thanks :)
 
Complete

Please search the forum, there are so many posts on this topic.
 
sure, thanks very much :)

I seem to have sorted it, access did it for me automatically (awesome!)

however, in a form, customly made, if i add another field/text box, how can i link it to make it autocomplete if another drop down box in the form can retrieve its data?

so when i have selected the item from the drop down list, i want the new text box i put in the form, to be filled in automatically?


what about a calculation:

i have a rate per hour, depending on the carID chosen in my form. I have a prices table hooked up to the Car table in a relationship, i want to do simple calcs.
 
Tech said:
in a form, customly made, if i add another field/text box, how can i link it to make it autocomplete if another drop down box in the form can retrieve its data?
This is kinda like what the combobox is all about. That's why it has a rowsource and a recordsource. Look things up in one place, and store them (or a key that points to them) in another place.
Like, you don't need the text box that you speek of, you just use the combo box for that field's control.
Put one on a form and play with it.
 
i am playing with it, its a pain! :)
re reading your reply, what exactly do u mean?

I have a combo box with a "DriverID" and the data source is the table "drivers", the form is made from the table "bookings"

when i select the driver ID from that combo box, i want the text boxes that i have added in manually to this form, to be filled with the appropriate information (name, last name of that driver id)

any ideas?
 
Last edited:
Do you have a DriverID field in the bookings table? That should be where you connect your combobox's control source to. Then the row source can be used to look up the driver in the drivers table and store it in your bookings table. The combo box says the driver's name, but the driver's ID is stored in the DriverID field in the bookings table.
Do you need to display other info about the driver on this form?
 
that is correct.

In the bookings table, there is a driversID field, which is linked to the Drivers table field DriverID

The combo box for Drivers ID is from the bookings table, with the Row Source set to the drivers table, so it gets all the driversID from that table - cool!

but, i need to add a textbox manually. This textbox will display the name of the driver that the user chose from the driversID combo box.

once the user has selected the driver id from the drop down box, i want this textbox that i have manually added to the form, to be filled in with the drivers name from the drivers table.

how? :)
 
Turn on your controls wizard and then add a combo box.
Select "look up values in table/query", select table Drivers, select DriverName field, then near the end of the wizard, it asks if you'd like to store the value in a field...select your DriverID field (from the bookings table). Now look at what access filled in for you on the properties sheet. Note in particular that it has two columns and that the first one is 0" wide. The record source is DriverID from your form's recordsource. The row source is "Select Drivers.DriverID, Drivers.DriverName from Drivers" or something like that.
 
sweet :) wish there was a way of making it into a text box, but its cool, i can just disable it :) thanks!

what about calculations? :)

i have a table of "prices"
i have a table of "cars"
for each car, different prices per hour

i have a field in the bookings table "total bill" and "hours required"

calc = hours required*cost per hour of car chosen.
 
Last edited:
There are a lot of ways to do what you want to do.
How you have things set up and what you know will determine which method you use.
Do you have any thoughts on how you might do this?
 
i really have no idea at the minute.

faced another problem however,

i added a new field in the bookings table and saved it. but how do i get that field in the form? I created a text box manually for that field but cant see the new field in the control source property of that text box.

how do i refresh the control source so it syncs with the new field been added to the table? any ideas? does it exist?
 
i added a new field in the bookings table and saved it. but how do i get that field in the form? I created a text box manually for that field but cant see the new field in the control source property of that text box.
Look at your form's record source. This should give you the answer to your question
 
In design view, with the properties sheet showing, select "Form" from the dropdown in it.
 
thanks :)

*working on costs field....scratches head*

you've been a big help, thanks alot :) cant express my thanks to you enough!
 
i cant view my form in proper mode now!!! nothing is there but in design view, there are components there! whats happening?
 
Sounds like your record source is returning no records.
 
last Q i hope :)

i am also going to make an ASP.NET page out of this to do online bookings (this isnt for real, just a small project for me)

What i need to know is, i need to show the availible dates and times for a particular car availible.

my tables:
Bookings
Cars
Drivers
Customers

should i make a date and time tables with a relationship to the bookings table with custID?

basically, i need to set up a system where i can view the availible dates and times for car availibility.

what is the best approach for this?
 
You'll need these tables:

tblBookings
tblCars
tblCustomers

A driver is a customer.
No need for a separate "Driver" table.
As for your booking date / time, there's no reason why you would need to create a separate "date / time" table.

RV
 
driver isnt a customer... a driver is one of the staff... really should be called staff instead :)
 

Users who are viewing this thread

Back
Top Bottom