Either Or Select Distinct Row

steve21nj

Registered User.
Local time
Today, 17:14
Joined
Sep 11, 2012
Messages
260
Is it possible to change this query to search for either a Name or by an employee ID number? The query runs a report on after update. Currently I can only enter the name not the employee ID

Code:
SELECT DISTINCTROW First(Inventory.Employee) AS FirstOfEmployee, Inventory.[Employee ID] FROM Inventory GROUP BY Inventory.[Employee ID] ORDER BY First(Inventory.Employee);

thank you
 
Yes, that's possible, but first . . .

"The query runs a report on after update" of what? How does a query run a report? By AfterUpdate, you almost certainly mean the event of a control on a form.

Where do you enter the name? Is that the form control that raises the AfterUpdate event? Does that update event modify this query somehow?

Narrowing it down,
 
The query is the row source for an unbound field on a text box within a form. The after update is triggered by user entry.
That selection filters a report.
Hope that helps
 
I'm sorry, I still don't get it. A TextBox doesn't have a RowSource, do you mean ControlSource? Yes, AfterUpdate is always triggered by user action. How is the report filtered?
 
You are correct, its not a text box, rather an unbound combo box. The combo's row source is the original query.

The vba opens the report after update, nothing fancy.
Code:
Private Sub Combo2_AfterUpdate()
    DoCmd.OpenReport "EmployeeHistory", acViewPreview
End Sub
 
OK, but I still don't understand the problem. I'll keep checking back.
 
Yes, that's possible, but first . . .
,
OK, but I still don't understand the problem. I'll keep checking back.


You mentioned that it is possible. can you give me a path forward on a sample query where I could use an unbound combo box to search two fields instead of just one in my present query.
 

Users who are viewing this thread

Back
Top Bottom