Sounds like relationship is backwards. If you want to provide db for analysis, follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
note the pencil icon in top form. This record is either in edit mode or not saved yet. Which one is the parent record and which is the child? Bottom looks like child to me, so you're trying to enter a child record before the parent record has been saved.
EDIT -That makes sense.Sounds like relationship is backwards.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Hi Guys, I've added the database file to my initial post for review. Thanks.
Hi Guys, I'm trying to achieve a simple process. Open a contact form, create a new contact, then click a button to open an event form to create a new contact event. For some reason I'm just missing the connect to achieve this. Any help would be appreciated. Thanks.
Okay, relationship is fine if each contact can have only one event.
However, tblEventLog cannot be a subform for tblContact. You need a combobox on main form to select an event. tblEventLog would be lookup source for combobox. If you need to enter a new event then that must be done on an independent form. If event is not listed in combobox, use NotInList event code to create new event record on-the-fly during data entry for contact.
If each event can have only one contact and each contact can have many events, then the relationship is backwards - store ContactID into event record.
If each contact can associate with multiple events and each event can have multiple contacts, that is many-to-many relationship and requires a third 'junction' table.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Guys, is it possible from the contacts form to open the event form, automatically select the FK matching the PK of the current selected record, rather than me manually search and select it in the text/combo box? Thanks.
Can have a combobox on tblEventLog form for the contact.
What is Person field for?
Remove EventFK from tblContacts table and form.
If you mean open to a specific EventID, subform container would have to hold a form, not a table. Then code behind that form can reference its EventID.
DoCmd.OpenForm "fmEvents", , , "EventID = " & Me.EventID
These would have to be two different forms for events.
If you mean open event form filtered by ContactID
DoCmd.OpenForm "fmEvents", , , "ContactFK=" & Me.ContactID
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
The person field is for the person's name I'm speaking with for that event, either by phone, in person or by correspondence. This is more related to calling a contact card who's a company or business. Thanks for the VBA too. Will try that.