G
Gavin Webb
I am trying to run a select query using a value from a
field within a Form.
I have a working query, which displays the results in a
grid.
The problem is that I want to use the first value
displayed in the future. I want to store it as a string
variable within the form.
What do I need to do?
This is what I have in the form:
Private Sub Cbo_ReportedBy_Change()
strReportedBy = Cbo_ReportedBy.Value
DoCmd.OpenQuery ("Query1")
End Sub
and this is the query I run:
SELECT [tbl_Users].[UserDept]
FROM tbl_Users
WHERE ((([tbl_Users].[UserID])=[Forms].[Frm_Main].
[strReportedBy]));
What do I need to change?
field within a Form.
I have a working query, which displays the results in a
grid.
The problem is that I want to use the first value
displayed in the future. I want to store it as a string
variable within the form.
What do I need to do?
This is what I have in the form:
Private Sub Cbo_ReportedBy_Change()
strReportedBy = Cbo_ReportedBy.Value
DoCmd.OpenQuery ("Query1")
End Sub
and this is the query I run:
SELECT [tbl_Users].[UserDept]
FROM tbl_Users
WHERE ((([tbl_Users].[UserID])=[Forms].[Frm_Main].
[strReportedBy]));
What do I need to change?