I want to open a Form using criteria from a subform.
I have a form that has two fields:
* Log# (AutoNumber)
* SubmittedBy.
SubmittedBy is automatically populated with the user ID associated with the person who originally created the record.
The current user's ID is sUser.
Right now, when someone enters the form, the docmd.openform criteria looks for the person's User ID and only opens the records this person submitted.
Here is the current working criteria:
stLinkCriteria = "SubmittedBy = '" & sUser & "'"
-----------
I created a subform and connected it to the mainform by the Log#.
The subform also has a field for alternate submitters.
I would like to open records based on the SubmittedBy Criteria "and" if the person is an Alternate Submitter.
The main form is named [frmDipAddrecords].
The Subform is named [AlternateSubmitters_SubForm]
The Alternate Submitter field name is [cmbUserId]
Here's my attemp for the docmd.openForm search criteria to try to open records for the Alternate Submitter.
stLinkCriteria = "[Forms]![frmDipAddrecords]![AlternateSubmitters_SubForm].Form![cmbUserId] = '" & sUser & "'"
The criteria does not bomb out. It just comes up saying there are no records for this criteria.
Thanks so much!!
Angelo
I have a form that has two fields:
* Log# (AutoNumber)
* SubmittedBy.
SubmittedBy is automatically populated with the user ID associated with the person who originally created the record.
The current user's ID is sUser.
Right now, when someone enters the form, the docmd.openform criteria looks for the person's User ID and only opens the records this person submitted.
Here is the current working criteria:
stLinkCriteria = "SubmittedBy = '" & sUser & "'"
-----------
I created a subform and connected it to the mainform by the Log#.
The subform also has a field for alternate submitters.
I would like to open records based on the SubmittedBy Criteria "and" if the person is an Alternate Submitter.
The main form is named [frmDipAddrecords].
The Subform is named [AlternateSubmitters_SubForm]
The Alternate Submitter field name is [cmbUserId]
Here's my attemp for the docmd.openForm search criteria to try to open records for the Alternate Submitter.
stLinkCriteria = "[Forms]![frmDipAddrecords]![AlternateSubmitters_SubForm].Form![cmbUserId] = '" & sUser & "'"
The criteria does not bomb out. It just comes up saying there are no records for this criteria.
Thanks so much!!
Angelo