I hope I can explain this and make any sense.
I am trying to make a form where I can choose in a query what fields I want displayed.
I have a combobox that I choose the table, and another combobox that list the fields that are available to view. So I get: tblZincWastewater.Analyst. Combobox#1 gives me tblZincWastewater and combobox#2 gives me Analyst.
Is anyone still following me?
I want to have 5 sets of choices, and have them display in a subform on that form.
I was able to get the query to work and get the data that I was looking for by doing this and doing it 5 times and creating a new query for each set:
strSQL = "SELECT " & Forms!Form1!analysisname1 & "." & Forms!Form1!headingname1 & ", tbldate.Field1 FROM (tblDate LEFT JOIN " & Forms!Form1!analysisname1 & " ON tblDate.Field1= " & Forms!Form1!analysisname1 & ".CollectionDate)" & " WHERE (((tblDate.Field1) Between #" & [Forms]![Form1]![DateStart] & "# And #" & [Forms]![Form1]![DateEnd] & "#));"
Set qdf = dbs.CreateQueryDef("Summary1", strSQL)
But I can't get the subform to work since, I think, because the field names change.
Anyone have a better way of going about this? Thanks in advance for any help.
I am trying to make a form where I can choose in a query what fields I want displayed.
I have a combobox that I choose the table, and another combobox that list the fields that are available to view. So I get: tblZincWastewater.Analyst. Combobox#1 gives me tblZincWastewater and combobox#2 gives me Analyst.
Is anyone still following me?
I want to have 5 sets of choices, and have them display in a subform on that form.
I was able to get the query to work and get the data that I was looking for by doing this and doing it 5 times and creating a new query for each set:
strSQL = "SELECT " & Forms!Form1!analysisname1 & "." & Forms!Form1!headingname1 & ", tbldate.Field1 FROM (tblDate LEFT JOIN " & Forms!Form1!analysisname1 & " ON tblDate.Field1= " & Forms!Form1!analysisname1 & ".CollectionDate)" & " WHERE (((tblDate.Field1) Between #" & [Forms]![Form1]![DateStart] & "# And #" & [Forms]![Form1]![DateEnd] & "#));"
Set qdf = dbs.CreateQueryDef("Summary1", strSQL)
But I can't get the subform to work since, I think, because the field names change.
Anyone have a better way of going about this? Thanks in advance for any help.