Cannot add a record

G

Guest

I have a form with the following SQL statement:
SELECT Orders.CustomerID, Customer.FirstName, Customer.LastName,
Customer.Address, Customer.City, Customer.State, Customer.ZipCode,
Customer.Phone, Customer.Fax, Orders.OrderID, Orders.CustomerID AS
Orders_CustomerID, Orders.TodaysDate, Orders.StartDate, Orders.EndDate,
Orders.ArriveTime, Orders.StartTime, Orders.EndTime, Orders.Notes,
Customer.CustomerNumber, Orders.CustomerID, Customer.CustomerID,
Customer.Email
FROM (Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID)
INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID;
I am trying to add an unbound combo box to the form above. I created a new
table, 'tblConfRooms'. This table contains the names of conference rooms. I
related the new table's primary key, RoomID with the table 'Orders' by adding
RoomID to it and creating an Enforced relationship. When I add the combo box
and try to add an order, I get the following error message: Error #3201
You cannot add or change a record because a related record is required in
'tblConfRooms'. I hope there is enough information here for someone to help
me with this.
Thanks
 
G

Guest

Hi Ron,

Usually when you get this error after adding a lookup list and referencing
it, it is because you have left the default value of zero against the field
in the main table, in this instance, RoomID in the Orders table. Remove the
default value of zero from this (as you don't have a Room with an ID of zero)
and it should work fine.

Damian.
 
G

Guest

Hi Damian
That was it.
Thanks

Damian S said:
Hi Ron,

Usually when you get this error after adding a lookup list and referencing
it, it is because you have left the default value of zero against the field
in the main table, in this instance, RoomID in the Orders table. Remove the
default value of zero from this (as you don't have a Room with an ID of zero)
and it should work fine.

Damian.

Ron Weaver said:
I have a form with the following SQL statement:
SELECT Orders.CustomerID, Customer.FirstName, Customer.LastName,
Customer.Address, Customer.City, Customer.State, Customer.ZipCode,
Customer.Phone, Customer.Fax, Orders.OrderID, Orders.CustomerID AS
Orders_CustomerID, Orders.TodaysDate, Orders.StartDate, Orders.EndDate,
Orders.ArriveTime, Orders.StartTime, Orders.EndTime, Orders.Notes,
Customer.CustomerNumber, Orders.CustomerID, Customer.CustomerID,
Customer.Email
FROM (Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID)
INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID;
I am trying to add an unbound combo box to the form above. I created a new
table, 'tblConfRooms'. This table contains the names of conference rooms. I
related the new table's primary key, RoomID with the table 'Orders' by adding
RoomID to it and creating an Enforced relationship. When I add the combo box
and try to add an order, I get the following error message: Error #3201
You cannot add or change a record because a related record is required in
'tblConfRooms'. I hope there is enough information here for someone to help
me with this.
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

Similar Threads


Top