You have have to try something a little loopy, such as the following:
Reports have a property called Tag
Open the Report in Design View
Open the Property Sheet and Select the 'Other' Tab
The Tag property is on the bottom of the list
You can access that Tag as follows:
Reports("Report Name").Tag
Simply replace the [Identifier]
with either Reports("Report Name").Tag
or Me.Tag
That way, if you open the query, you will still be prompted to input the UserID
When you open the Report, set Me.Tag
to whatever number you want. How to you set it in the first place ?
On the property sheet, Click Event Tab
. In the OnLoad Event
, click the three dots (ellipses). Menu pop ups. Click Code Builder
. VBA opens on with :
Private Sub Report_Load()
End Sub
Now put that setting in (say the UserID is from a form):
Private Sub Report_Load()
Me.Tag = Forms("Form Name")("Field Name")
End Sub
Give it a Try !!!
The last time I played with Access was when 2003 was the hot new thing, so this may not be entirely accurate to every detail. However, what you need to do is go to the query designer, change the view to "SQL" (i.e. raw text entry) and then you want to UNION
your two left-join queries together, e.g.
SELECT ListA.*, ListB.*
FROM ListA LEFT JOIN ListB ON ListA.[StaffID] = ListB.StaffID
UNION
SELECT ListA.*, ListB.*
FROM ListB LEFT JOIN ListA ON ListB.[StaffID] = ListA.StaffID
Best Answer
MS-Access is rather picky at how it wants the joins to be formed. Add parentheses:
Standard SQL syntax - and most other DBMS - do not need require parentheses in the
FROM
clause, although you are allowed to use them for clarity.