Form won't allow data entry

J

jwrnana

I have a form - Customer Info - and on that form I have two command buttons.
One button opens a form - Issuing Office - and data is from table Issuing
Office. The other button opens a form - Ship To - and that data is from a
query. Both forms are linked to the customer info by customer ID.

The issuing office form works from the command button, but the ship to form
will open the form, but will not allow data entry. I have looked at both
form properties and cannot see any difference.

Could you give me some suggestions, please?

Thanks in advance,
JR
 
R

Rick Brandt

jwrnana said:
I have a form - Customer Info - and on that form I have two command
buttons. One button opens a form - Issuing Office - and data is from
table Issuing Office. The other button opens a form - Ship To - and
that data is from a query. Both forms are linked to the customer
info by customer ID.

The issuing office form works from the command button, but the ship
to form will open the form, but will not allow data entry. I have
looked at both form properties and cannot see any difference.

Could you give me some suggestions, please?

Thanks in advance,
JR

Is the query updateable? Many are not.
 
J

jwrnana

I decided that that was the problem; therefore, I created a form from my
Ship To Table and added a command button linking Customer form and Ship to
form on the Customer ID. Now, the form allows data entry; however, I am
getting the message "cannot add or change a record because a related record
is required in the "Customer" table. My link field is Customer ID which is
in both tables.

When I open the form -- with the customer ID field having properties/data
source from the ShipTo table, the field is blank. If I change that field to
pull from Forms/Customer Table/Customer ID, the correct Customer ID
automatically displays; however, I still get that error message.

I am attempting to build a customer and on that same form, have a command
button that opens the ship to form FOR THAT PARTICULAR customer -- and no
other customers.

I don't understand.

Thanks,
JR
 
R

Rick Brandt

jwrnana said:
I decided that that was the problem; therefore, I created a form from
my Ship To Table and added a command button linking Customer form and
Ship to form on the Customer ID. Now, the form allows data entry;
however, I am getting the message "cannot add or change a record
because a related record is required in the "Customer" table. My
link field is Customer ID which is in both tables.

When I open the form -- with the customer ID field having
properties/data source from the ShipTo table, the field is blank. If
I change that field to pull from Forms/Customer Table/Customer ID,
the correct Customer ID automatically displays; however, I still get
that error message.

You need to save the Customer record before opening the other form.
 
J

jwrnana

Why does my issuing office command button not require this?
I really don't see any difference.

If, however, this is the case -- How do I accomplish this? I don't want
subform as it will be too lengthy.

Thanks,
JR
 
J

jwrnana

I have gone back to see if I can enter ship to info - after the customer
info has been loaded - from the customer form command button, and I still
get the same message.
 
R

Rick Brandt

jwrnana said:
I have gone back to see if I can enter ship to info - after the
customer info has been loaded - from the customer form command
button, and I still get the same message.

If you create a new Customer record and then while looking at that Customer
record open another form to add a record that is related to that Customer,
the CustomerID for the new Customer doesn't exist yet (in the tables) and it
won't until you first save the Customer record. If you do this for an
exsitng Customer record then there should not be a problem.
 
J

jwrnana

I created 2 forms using form wizard and selected synchronize. I allowed the
wizard to create the forms and synchronize for me. I STILL have the same
problem. I get the message that I cannot change or add anything because a
related record is required in Customer Table. Each table, customer and ship
to, have autonumber for the customer id and ship to id, and they are linked
via customer ID.

Any suggestions?
 
R

Rick Brandt

jwrnana said:
I created 2 forms using form wizard and selected synchronize. I
allowed the wizard to create the forms and synchronize for me. I
STILL have the same problem. I get the message that I cannot change
or add anything because a related record is required in Customer
Table. Each table, customer and ship to, have autonumber for the
customer id and ship to id, and they are linked via customer ID.

You are operating under a false assumption. That if one uses the wizard to
construct a form you are guaranteed a form that works properly.

Create individual forms for each *table*. No queries (at least not queries with
more than the base table in them. Make sure that each can be used to edit an
existing record. Then make sure that the Customer form can be used to create a
new customer.

Only after achieving the above, then drag the ship-to form from the db window
onto the design view of the customer form. It will be added as a subform and if
the relationships are set up on the table it should automatically set the
Masterlink and ChildLink properties. You should now find that you can use the
form/suform combination without problems.
 
J

jwrnana

I have created a form for each table. I used a command button because I did
not want the second form to be visible at all times. If I use a subform, it
is always open, isn't it, when the main form is?

I created the first form, customers, and it worked fine. I created one
subform, shipto, and then dragged it to the customer form. I entered the
shipto information in the subform - both ways --after creating customer and
closing form, and then subform, as well as inputing all information at the
same time. I can go back to previous customers that were already entered
and already had ship to information, but the only ship to information is the
very first one that I entered into the new subform. It does not stay with
the appropriate customer.

Questions:
1. Can I have more than 1 subform with a form?
2. Can the 2 subforms be "tied" to the customerID field in the customer
form? (Both subforms from tables have a relationship via acustomerID.)
3. When the customer form is open, I only want to see the information in my
subforms that pertain to that customer.
4. If multiple subforms will not work, why won't my command buttons work?
My apologies for having to ask again, but I am missing something. Thank you
for your assistance.
 
R

Rick Brandt

jwrnana said:
I have created a form for each table. I used a command button
because I did not want the second form to be visible at all times.
If I use a subform, it is always open, isn't it, when the main form
is?

I created the first form, customers, and it worked fine. I created one
subform, shipto, and then dragged it to the customer form. I
entered the shipto information in the subform - both ways --after
creating customer and closing form, and then subform, as well as
inputing all information at the same time. I can go back to previous
customers that were already entered and already had ship to
information, but the only ship to information is the very first one
that I entered into the new subform. It does not stay with the
appropriate customer.

This suggests that the MasterLink and ChildLink properties of the subform
control are not set correctly.
Questions:
1. Can I have more than 1 subform with a form?
Yes.

2. Can the 2 subforms be "tied" to the customerID field in the
customer form? (Both subforms from tables have a relationship via
acustomerID.)

That is as it should be using MasterlInk and ChildLink. The field names
that relate the tables together need to be entered into these properties.
3. When the customer form is open, I only want to see the
information in my subforms that pertain to that customer.

See above.
4. If multiple subforms will not work, why won't my command buttons
work? My apologies for having to ask again, but I am missing
something. Thank you for your assistance.

You can do the same thing as a subform with a form that you open separately
but then YOU have to add code and properties that replace all of the built
in stuff that an embedded subform provides for you. You would have to use
code to make the "subform" automatically stay synchronized with the Customer
form as you navingate in the latter. You would need to set the DefaultValue
properties of the linking fields so that any new record added into the
ShipTo form automatically inherit the values in the Customer form.
 

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