kwasi
02-25-2002, 02:59 PM
I have 2 Tables - Client Details and Contact Log. How do I link these together so that when in the Client Details form the user clicks on the Contact Log button it enters new entries into the Contact Log table. So that when the user presses the Contacts Log button in the Client Details form, they can view that Clients' contact log "history". Hope that made sense and please feel free to email me directly. Much appreciated!
David R
02-25-2002, 03:19 PM
I've done something similar, actually from my Contacts Log it pulls information into a new Event.
Behind the 'Create New Event' button:
Private Sub buttonMoveRecord_Click()
On Error GoTo Err_buttonMoveRecord_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "CFS_Events", , , , acFormAdd
Forms![CFS_Events]![FirstName] = Forms![Contacts]![FirstName]
Forms![CFS_Events]![LastName] = Forms![Contacts]![LastName]
Forms![CFS_Events]![Title] = Forms![Contacts]![Title]
Forms![CFS_Events]![TelephoneNumber] = Forms![Contacts]![TelephoneNum]
Forms![CFS_Events]![Location] = Forms![Contacts]![AgencyAddress]
Forms![CFS_Events]![EventName] = Forms![Contacts]![AgencyName]
Exit_buttonMoveRecord_Click:
Exit Sub
Err_buttonMoveRecord_Click:
MsgBox Err.Description
Resume Exit_buttonMoveRecord_Click
End Sub
And to open another form, to a specific record, you will have to specify criteria. Otherwise just use:
DoCmd.OpenForm "FormName"
If you keep typing commas after the form name, you will see the other options available to OpenForm. Very useful.
HTH,
David R