editing a query

  • Thread starter cmtrain via AccessMonster.com
  • Start date
C

cmtrain via AccessMonster.com

I have two tables - tblPeople and tblBooking. Referential Integrity is set
from tblPeople to tblBooking on the Client_ID field, which is an AutoNumber
data type. I created a query with these tables. When try to add new data, I
am only able to enter data in the fields of the tblPeople table. To enter in
the tblBooking table fields, I first need to type something in any of the
existing rows of that field and then type in the new record. Does anyone have
any ideas of what I need to do to be able to enter new data?
 
M

Marshall Barton

cmtrain said:
I have two tables - tblPeople and tblBooking. Referential Integrity is set
from tblPeople to tblBooking on the Client_ID field, which is an AutoNumber
data type. I created a query with these tables. When try to add new data, I
am only able to enter data in the fields of the tblPeople table. To enter in
the tblBooking table fields, I first need to type something in any of the
existing rows of that field and then type in the new record. Does anyone have
any ideas of what I need to do to be able to enter new data?


You should not be using a query to enter/edit data. This is
especially true if the query is based on more than one
table.

Instead you should be using a form based on the people table
and a subform based on the booking table.

Regardless of how you approach it, the people table record
must be saved before you can add a new record to the booking
table. You have seen this when you cause a new people
record to be saved by clicking on another record and
clicking on a booking field in the "new" record. If you use
a main form, subform arrangement, the main form record is
automatically saved as soon as you click/tab to a subform
control (field).
 

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