Form Data Entry Problem

G

Guest

I've got a form called frmCustomers. Inside this form is subform
(sfrmCustProdRates). In sfrmCustProdRates I have a command button that opens
frmTransactions. The intent is to associate products to customers and to
enter transaction details for those product/customer combinations. I believe
I have my relationships set up correctly, because I can go into the TABLE
(tblCustomers) and cascade my way down properly into tblTransactions.

However, when I try and enter data using the forms I've set up,
frmTransactions does not associate the transaction entered to a CustID,
therefore the transaction isn't saved. It correctly displays data entered
through the TABLES, but I can't enter the data through the FORMS.

Any ideas?
 
R

Rick Brandt

Kirk said:
I've got a form called frmCustomers. Inside this form is subform
(sfrmCustProdRates). In sfrmCustProdRates I have a command button
that opens frmTransactions. The intent is to associate products to
customers and to enter transaction details for those product/customer
combinations. I believe I have my relationships set up correctly,
because I can go into the TABLE (tblCustomers) and cascade my way
down properly into tblTransactions.

However, when I try and enter data using the forms I've set up,
frmTransactions does not associate the transaction entered to a
CustID, therefore the transaction isn't saved. It correctly displays
data entered through the TABLES, but I can't enter the data through
the FORMS.

Any ideas?

Relationships do not automatically cause key values to propagate to other
tables. Forms with *embedded* subforms will automatically propagate key fields
from the main record into the sub-record, but when you open a related form as a
separate form then you don't get this behaviour unless YOU design it in.

If the transactions form is ONLY used as a popup like you describe above then
you can set the DefaultValue property for the CustID so it references the
frmCustomers form. The default value entry would look like...

=Forms!frmCustomers!CustID

If you ever try to enter a new record into the transactions form when the
customers form is not open you will get an error.
 

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