I've got a subform with a control in it where I put a condition on the Row source. The Row source statement reads like this:
SELECT tblSegments.SegmentsID, tblSegments.JobNumber, tblSegments.Segments FROM tblSegments WHERE ((tblSegments.JobNumber)=(Forms.frmProjectInfo!Job Number.Value));
I have recently found that I need two different Main Forms with the same subform. The above doesn't work as I need a statement that more reads:
SELECT tblSegments.SegmentsID, tblSegments.JobNumber, tblSegments.Segments FROM tblSegments WHERE ((tblSegments.JobNumber)=(Forms.frmAllProjects!JobNumber.Value));
I know I can change Row source through the vba code based on what Main Form I am in, but I don't know what kind of notation I need. The italicized part is what I need help with.
Private Sub sfrmSubDetStatus_Enter()
Forms!sfrmSubDetStatus.Segment.RowSource = SELECT tblSegments.SegmentsID, tblSegments.JobNumber, tblSegments.Segments FROM tblSegments WHERE ((tblSegments.JobNumber)=(Forms.frmProjectInfo!Job Number.Value))
End Sub