Hello,
I have this saved query:
SELECT tblFullRecords.GroupID, tblFullRecords.DistrictID, tblFullRecords.Names, tblFullRecords.GENDER, tblFullRecords.Designation, tblFullRecords.DateOfReg
FROM tblFullRecords
WHERE (((tblFullRecords.GENDER)="male") AND ((tblFullRecords.Designation)="member") AND ((tblFullRecords.DateOfReg)="day 1"));
(I just copied the SQL string from the object directly)
Now I need to change the criteria : tblFullREcords.DateOfReg = "day 1" to pick up the value of a control cboSelectDay in my form each time the code runs. I could use expression builder but I need to use VBA code to allow for other variables in the project. So, how can I achieve this using VBA codes?
There are five other five queries I need to carry out this same procedures on. Rather than work with saved queries, is there a way I can dynamically create and alter these queries in VBA?
Thanks
I have this saved query:
SELECT tblFullRecords.GroupID, tblFullRecords.DistrictID, tblFullRecords.Names, tblFullRecords.GENDER, tblFullRecords.Designation, tblFullRecords.DateOfReg
FROM tblFullRecords
WHERE (((tblFullRecords.GENDER)="male") AND ((tblFullRecords.Designation)="member") AND ((tblFullRecords.DateOfReg)="day 1"));
(I just copied the SQL string from the object directly)
Now I need to change the criteria : tblFullREcords.DateOfReg = "day 1" to pick up the value of a control cboSelectDay in my form each time the code runs. I could use expression builder but I need to use VBA code to allow for other variables in the project. So, how can I achieve this using VBA codes?
There are five other five queries I need to carry out this same procedures on. Rather than work with saved queries, is there a way I can dynamically create and alter these queries in VBA?
Thanks