troubleshooting Question

rerun a query after on change event in form combobox

Avatar of Yaniv Schiff
Yaniv SchiffFlag for United States of America asked on
Microsoft AccessSQL
9 Comments2 Solutions556 ViewsLast Modified:
I have a form with a combo box where a user can select a project id. After selecting the project id the user can click on 1 of 3 buttons that takes the project id selected and queries 1 of 3 tables for all responsive records. This all works fine. The selection form stays open so that the user doesn't have to reopen it to rerun a query. The problem i running into though is the user can't change the selected project id and rerun the queries. I can't figure out where to put the code to rerun the query, is it under "On Change" or "AfterUpdate" and is it associated with the combo box or the query buttons? Below is the code for the three query buttons and the sql for one of the queries run.
Private Sub SearchIntake_Click()
DoCmd.OpenQuery "PhysicalItem Query By ProjectID", acViewNormal, acEdit
 
End Sub
 
 
Private Sub SearchTransferIN_Click()
DoCmd.OpenQuery "TransferIN Query By ProjectID", acViewNormal, acEdit
End Sub
 
Private Sub SearchTransferOUT_Click()
DoCmd.OpenQuery "TransferOUT Query By ProjectID", acViewNormal, acEdit
End Sub
 
=-----------------------------------------------------------------------------
PhysicalItem Query By ProjectID
 
SELECT PhysicalItem.PhysicalItemGUID, PhysicalItem.ProjectID, PhysicalItem.ItemNumber, PhysicalItem.Type, PhysicalItem.Make, PhysicalItem.Model, PhysicalItem.SerialNumber, PhysicalItem.Notes, PhysicalItem.Custodian, PhysicalItem.Description, PhysicalItem.Location, PhysicalItem.ActiveUse
WHERE (((PhysicalItem.ProjectID)=[Forms]![_SearchByProjectID]![cboProjectID]));
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros