Aaron
Member
Registered: 9th Aug 04
Location: Cottingham, East Riding
User status: Offline
|
I have to make a database for a car hire company (for a uni assignment)
All tables have been made, linked together using the correct relationships etc...oh, and i've populated them with all the required records (50).
I need to make a form which the person at the car hire company will fill in when a customer walks in or calls up on the phone.
The form i want to have will contain the customer details (name, address, contact number, d.o.b etc) and also some basic info about the car they want to hire...the type of car (small compact, family etc) and the number of doors.
The information about the customer and car are on different tables, and can i fook work out how to create a form which allows me to populate the information to both tables from only one form. When i select all the data i want from the customer table to go in the form, all is fine. Then, i select the info i want from the car table (car type, and number of doors)...and when i click "finish" (to create the form), all i get is a box on the screen with the title of "Rental" (which is the name of one of my tables)
I dont get it
Any ideas?
Databases are gay. Fact.
[Edited on 27-12-2009 by Aaron]
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
It should be three tables because there's a many to many relationship between customers and cars, rental being the intermediary junction table.
You need to be clear what you're writing to and what are lookups that don't need a write. Booking the rental is a write to the rental table, but you need customers and car in place first as there should be referential integrity on the relationships so you can't have an orphan rental record which doesn't have a corresponding dependency. But you are only writing to the rental table, not to the others. Design your form with this in mind.
I'm not big on forms as I would generally write a proper app, and its also been a while since I used 2003 but my guess would be to alter the table design of the rental table so its a Lookup column (2007 does this, not sure about 2003), and create the form after this change is made.
You could also make a query where the three tables are included and you've got the correct field names in place then design the form based on the query, not the single tables. Again, I'm only guessing as I'm not sure exactly what functionality you have available.
|
Aaron
Member
Registered: 9th Aug 04
Location: Cottingham, East Riding
User status: Offline
|
I sort of understand what you're trying to say, but i still can't sort it.
Dont suppose anyone on here would be kind enough to take a look? the database file is only about 3.3MB, so can be easily e mailed.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
In short - the booking is not one form.
If the phone call relates to making a booking, you need the rental table. This assumes the customer details are in place (and also car, but they're more likely to be).
If you need to add or edit customer details, I would guess that you need to do this on another form.
|
Ian W
Member
Registered: 8th Nov 03
Location: Wirral, Merseyside
User status: Offline
|
Easiest way to do this is just create a form which allows you to input the information that you want then use code behind the form to write the table updates.
You can use your existing table that holds car information to filter selections on the form if you wish.
When you hit finish have vba write all infromation to the tables, job done
|