Problem Linking Forms

PaulJK

Registered User.
Local time
Today, 06:55
Joined
Jul 4, 2002
Messages
60
I have a customer database which has a form (frmproducts) linked to the main customer form (frmcustomers) by client id. Records are shown for all salespeople.

In addition to this I have been asked to show customer records by salesperson.

In a new query behind a new frmProductsOwnRecords I added a field which is a salespersons id and a parameter request asking for this . Therefore when then opened the frmProductsQuwrecords they would be asked for their id and on entering it their customer bank would be shown.

My problem relates to the linked form. Existing records are shown but when I try and add a new product, the details are not shown or saved. I have check the code and their is a link by customer id.

Everything works ok for the forms not asking for the parameter salespersons id.

I presume I am missing something obvious. Help would be very much appreciated as I have an impending deadline on this.

Thank you.
 
I am still trying to get my head around this one.

On the OnClick to open rmProductsOwnRecords I have the following code:

DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProtectionPolicyDetailsOC"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

However the CustomerID is shown for existing customer records, but when adding new product records I receive a #Name? error suggesting the Customer ID is not transferred to this form (frmProductsOwnRecords ).

I have tried to change the control source to equal the Customer ID on frmCustomers, but this still does not save any new records correctly. The default value is this anyway.

I am getting very baffled and would appreciate any help.
 

Users who are viewing this thread

Back
Top Bottom