Linked form does not allow data to be entered

Jetjefferson

New member
Local time
Today, 00:05
Joined
Dec 12, 2007
Messages
8
I have set up a database (blank file attached) to record lead information and details of contact made with the prospective clients.

When the Contact History button is clicked, it opens a dataform which should allow a record of the contact to be logged. Everytime I try to do this however I get the following message: "You cannot add or change a record because a relatedrecord is required in table 'Leads'."

I can't see where the problem is. Can anyone help please?

Thanks

Derek
 

Attachments

Seems to me that you have created 1:N relationships between your tables. Now you want to add a record in one table (N-side) while the other table (1-side) isn't populated yet.
You have to fill the 1-side first b4 u can enter corresponding data in the N-side table.

Do i make any sense?
 
I follow what you are saying, however I thought I had the details entered into the 1 table when I was trying to enter the details in the N table.

Did you try putting data into the main table and then enter data into the contact history? I did that and still got that message.

Maybe I've misunderstood what you are saying.

Cheers

Derek
 
I hadn't looked at your database yet. I have now.
It seems that Lead Status, Recruiter Names and Regions have a 1:1 relationship with the leads table. If you don't change them to a 1:N relationship you won't be able to enter each value (Lead Status, Recruiter Names and Regions) more than once in the Leads table.

HTH:D
 
I've been playing around with the forms and have narrowed down my problem to this:

When I click the 'Contact History' button, I want to display the data entry form and have a default in the 'ID' field (which will not be displayed) as the ID from the record from which the 'Contact History' Button was clicked.

I suspect I need to alter the VBA code behind the button to allow this but do not know how this is done.

The VBA code I have at present is:

Private Sub Cont_History_Click()
On Error GoTo Err_Cont_History_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Contact Form"

stLinkCriteria = "[ID]=" & [ID]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

Exit_Cont_History_Click:
Exit Sub

Err_Cont_History_Click:
MsgBox Err.Description
Resume Exit_Cont_History_Click

End Sub


Thanks

Derek
 

Users who are viewing this thread

Back
Top Bottom