Hi folks, i need some help - Im trying to pass the Where Clause, from one Form to another Form which is connected to a Union Query; when the Forms Click Event is triggered.
Setup:
I have a Form that contains a link, which creates the Where Clause and then opens another Form, which is tied to a Union Query which generated a Dialog Box - requesting the user to input a value.
I would like the Where Clause value generated by the First Form to populate the Queries Dialog box tied to the Second Form, so the user does not need to re-type the value.
Union Query:
SELECT DBIDs.DBID, DBIDs.DBIDDesc, DBIDs.FileNo, DBIDs.LowRecCd, DBIDs.HiRecCd, DBIDs.StartPos, DBIDs.FieldLen, DBIDs.ModeInd, DBIDs.BucketInd, DBIDs.InputLen, DBIDs.EditLen, DBIDs.EditInd, DBIDs.EditFlag, DBIDs.SpecDBIDRtine, DBIDs.UpdateFlag, DBIDs.[850DBID], DBIDs.[850DefaultInd]
FROM DBIDs INNER JOIN TRANCdDetail ON DBIDs.DBID = TRANCdDetail.DBID
WHERE (((DBIDs.DBID)= SearchDBID));
UNION ALL SELECT
ExplodDBIDs.DBID, ExplodDBIDs.DBIDDesc, ExplodDBIDs.FileNo, ExplodDBIDs.LowRecCd, ExplodDBIDs.HiRecCd, ExplodDBIDs.StartPos, ExplodDBIDs.FieldLen, ExplodDBIDs.ModeInd, ExplodDBIDs.BucketInd, ExplodDBIDs.InputLen, ExplodDBIDs.EditLen, ExplodDBIDs.EditInd, ExplodDBIDs.EditFlag, ExplodDBIDs.SpecDBIDRtine, ExplodDBIDs.UpdateFlag, ExplodDBIDs.[850DBID], ExplodDBIDs.[850DefaultInd]
FROM ExplodDBIDs INNER JOIN TRANCdDetail ON ExplodDBIDs.DBID = TRANCdDetail.ExplodDBID
WHERE (((ExplodDBIDs.DBID)=SearchDBID));
Forms Click Event:
Dim strWhere As String
strWhere = "[SearchDBID] =" & " '" & Forms![frmDBIDNamesList]![DBID] & "'"
DoCmd.OpenForm "frmDBIDSummary2", acNormal, , strWhere
Setup:
I have a Form that contains a link, which creates the Where Clause and then opens another Form, which is tied to a Union Query which generated a Dialog Box - requesting the user to input a value.
I would like the Where Clause value generated by the First Form to populate the Queries Dialog box tied to the Second Form, so the user does not need to re-type the value.
Union Query:
SELECT DBIDs.DBID, DBIDs.DBIDDesc, DBIDs.FileNo, DBIDs.LowRecCd, DBIDs.HiRecCd, DBIDs.StartPos, DBIDs.FieldLen, DBIDs.ModeInd, DBIDs.BucketInd, DBIDs.InputLen, DBIDs.EditLen, DBIDs.EditInd, DBIDs.EditFlag, DBIDs.SpecDBIDRtine, DBIDs.UpdateFlag, DBIDs.[850DBID], DBIDs.[850DefaultInd]
FROM DBIDs INNER JOIN TRANCdDetail ON DBIDs.DBID = TRANCdDetail.DBID
WHERE (((DBIDs.DBID)= SearchDBID));
UNION ALL SELECT
ExplodDBIDs.DBID, ExplodDBIDs.DBIDDesc, ExplodDBIDs.FileNo, ExplodDBIDs.LowRecCd, ExplodDBIDs.HiRecCd, ExplodDBIDs.StartPos, ExplodDBIDs.FieldLen, ExplodDBIDs.ModeInd, ExplodDBIDs.BucketInd, ExplodDBIDs.InputLen, ExplodDBIDs.EditLen, ExplodDBIDs.EditInd, ExplodDBIDs.EditFlag, ExplodDBIDs.SpecDBIDRtine, ExplodDBIDs.UpdateFlag, ExplodDBIDs.[850DBID], ExplodDBIDs.[850DefaultInd]
FROM ExplodDBIDs INNER JOIN TRANCdDetail ON ExplodDBIDs.DBID = TRANCdDetail.ExplodDBID
WHERE (((ExplodDBIDs.DBID)=SearchDBID));
Forms Click Event:
Dim strWhere As String
strWhere = "[SearchDBID] =" & " '" & Forms![frmDBIDNamesList]![DBID] & "'"
DoCmd.OpenForm "frmDBIDSummary2", acNormal, , strWhere
Last edited: