New to Access and trying to develop forms to use database as opposed to filling in tables directly.
Simple database based on Microsoft's Contact List having added a "Visit" table which has three fields - VisitID (key), _ContactID (foriegn key to link to ContactID, Notes (memo field to record visit details)
I have renamed Contact Details form to frmContactDetails and included several tabs to show grouped infomration e.g. Business Details, Contact Details, Operational Details, Business Plans, Visit Details and Attachments.
My idea is to be able to scroll through the list of contacts (which works fine) and by opening the Visit Details tab scroll down the list of visit dates and for each visit date highlighted the relevant notes for that visit are displayed in the visit notes subform (this is not working)
My issues are with the manner in which I am referencing the subforms on the Visit Details tab, in particular the visit details (i.e. memo field).
I have created two subforms:
sfrmVisitDates: Name - VisitDates
Source Object - sfrmVisitDates
Link Master Fields - ContactID
Link Child Fields - _ContactID
Event: On Current - Event Procedure as follows:
sfrmVisitDetails: Name - VisitNotes
Source Object - sfrmVisitDetails
Link Master Fields - [sfrmVisitDetails].Form.[VisitID]
Link Child Fields - VisitID
When opening (running) frmContactDetails I am presented with the following "Contact Management Database can't find the field 'sfrmVisitDetails' referred to in your expression. Clicking on OK them displays another dialog box Enter Paramerter Value - sfrmVisitDetails.For.VisitID [text box] [OK] [Cancel].
I have read through numerous threads but still can't see the error I am obviously making. I have tried swapping the reference sfrmVisitDetails with [Visit Details Subform] with no success.
I hope someone can see where my error, which I'm sure is very obvious to those more experienced.
Thanks Peter
Simple database based on Microsoft's Contact List having added a "Visit" table which has three fields - VisitID (key), _ContactID (foriegn key to link to ContactID, Notes (memo field to record visit details)
I have renamed Contact Details form to frmContactDetails and included several tabs to show grouped infomration e.g. Business Details, Contact Details, Operational Details, Business Plans, Visit Details and Attachments.
My idea is to be able to scroll through the list of contacts (which works fine) and by opening the Visit Details tab scroll down the list of visit dates and for each visit date highlighted the relevant notes for that visit are displayed in the visit notes subform (this is not working)
My issues are with the manner in which I am referencing the subforms on the Visit Details tab, in particular the visit details (i.e. memo field).
I have created two subforms:
sfrmVisitDates: RecordSource - VisitsQuery
Caption -Visit Dates Subform
Default View - Datasheet
sfrmVisitDetails: RecordSource - Visits
Caption - Visit Details Subform
Default View - Single Form
On the frmContactDetails (on the Visit Details tab):Caption -Visit Dates Subform
Default View - Datasheet
sfrmVisitDetails: RecordSource - Visits
Caption - Visit Details Subform
Default View - Single Form
sfrmVisitDates: Name - VisitDates
Source Object - sfrmVisitDates
Link Master Fields - ContactID
Link Child Fields - _ContactID
Event: On Current - Event Procedure as follows:
Code:
Private Sub Form_Current()
' This code created by Form Wizard.
Dim strParentDocName As String
On Error Resume Next
strParentDocName = Me.Parent.Name
If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![sfrmVisitDetails].Requery
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Err.Description
Resume Form_Current_Exit
End Sub
sfrmVisitDetails: Name - VisitNotes
Source Object - sfrmVisitDetails
Link Master Fields - [sfrmVisitDetails].Form.[VisitID]
Link Child Fields - VisitID
When opening (running) frmContactDetails I am presented with the following "Contact Management Database can't find the field 'sfrmVisitDetails' referred to in your expression. Clicking on OK them displays another dialog box Enter Paramerter Value - sfrmVisitDetails.For.VisitID [text box] [OK] [Cancel].
I have read through numerous threads but still can't see the error I am obviously making. I have tried swapping the reference sfrmVisitDetails with [Visit Details Subform] with no success.
I hope someone can see where my error, which I'm sure is very obvious to those more experienced.
Thanks Peter