Is it possible to create a query in the designer that looks for a value from a Form control?
For example, I have two tables:
tblContacts , tblCampaigns
I have a form frmCampaigns . This will be tracking my marketing campaigns. On the form is a is a field name that I will be turning into a button. When someone clicks that button I want it to open a query result.
It should list all of the contacts from my contact table that have the same campaign ID as the campaign form I'm on.
I hope I didn't just confuse everyone.
I did make this query in the query designer and it works but I already have the WHERE set to 1...When it's on the form it needs the WHERE set to Me!ID of the current record.
Can I do this from the designer or do I have to create it in VBA code.
Here is the sqlview of the query from the designer.
Code:SELECT tblContacts.FirstName, tblContacts.LastName, tblCampaigns.CampaignCode FROM tblCampaigns INNER JOIN tblContacts ON tblCampaigns.ID = tblContacts.Campaign_ID WHERE (((tblCampaigns.ID)= 1));