Problems with entering data

G

Guest

Hello.
I want to create a database for Vehicle bookings. I currently have 3 tables:
tblVehicles (stores info about each car), tblUsers (stores info on each
person who can book cars) and tblVehicleBookings(stores each booked
appointment by the users).
I created a query which brought together fields from each of the tables and
made a frmBookingForm from the results. I had hoped that this would allow
each user to enter new appointments for their desired vehicle but when
testing all I could do was view the test data that I had already entered but
could NOT enter a new appointment from this form - the fields just wouldnt
let me enter anything into them.
Does anybody know what could be wrong or what I could do differently? Is
this the right way to try and get fields from multiple tables onto one form?
Many thanks in advance
Nigel
 
G

Guest

You're really close. You want to base the form on tblVehicleBookings and not
a query that includes all three tables. I'm assuming that tblVehicleBookings
includes foriegn key fields that link to the primary keys of the other two
tables.

I often use combo boxes with the other table as their row source. I use
multiple columns so that the user can see information on the vehicle as in
your case.

You can show the other two tables in subforms or using DLookup in unbound
fields on the main form.
 
G

Guest

Thanks for your swift reply.

As for the foreign keys, all they are are the primary keys in other tables,
right? There's nothing I have to actually 'do' to link these to the other
tables? All i did was type in the same field name for the foreign keys in the
tblVehicleBookings table.

The combo boxes with row sources going to the other tables is exactly what i
want to do too!

I don't think I need to use subforms or D Lookup in this instance though -
that's not a problem is it?

Many many thanks for your help, I really appreciate it
 
G

Guest

There is one more thing that you should do. Go up to the Relationships window
and formally link the tables together. Also enable Referential Integrity. If
it won't let you, chances are that you have some dirty data or another
problem.
 
G

Guest

Thanks for your help Jerry.
One last question, why doesn't the form based on a query allow me to enter
data? I have read in several books that this can be done but I have not
succeeded in doing so!
Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top