gbnorton
asked on
Open Access Report using varying columns
I have a table with 25 field names like this:
slot_1
slot_2
slot_3
... slot_25
I have a report that will only need one of the fields at a time. The report should be formatted like this:
Date: Slot_(x)
4/10/12 .011
4/10/12 .010
4/10/12 .012
The data in the slot column will vary depending on which slot is being used.
I have the field name from a non visible text box on the form that opens the report.
The report is opened like this:
strWhere = "Select Burn_In_Date, " & strSlot
strWhere = strWhere & " FROM Part_Voltage"
strWhere = strWhere & " WHERE (((Part_Voltage.BurnIn_Dat e) Between [Forms]![frm_rpt_Report1]! [txtBurn_I n_Start] And DateAdd("
strWhere = strWhere & "'h'"
strWhere = strWhere & ",20,[Forms]![frm_rpt_Repo rt1]![txtB urn_In_Sta rt])));"
DoCmd.OpenReport "rpt_PartVoltage", acViewPreview, strWhere
Can I use a variable for a field name?
Some other way?
Thanks,
Brooks
slot_1
slot_2
slot_3
... slot_25
I have a report that will only need one of the fields at a time. The report should be formatted like this:
Date: Slot_(x)
4/10/12 .011
4/10/12 .010
4/10/12 .012
The data in the slot column will vary depending on which slot is being used.
I have the field name from a non visible text box on the form that opens the report.
The report is opened like this:
strWhere = "Select Burn_In_Date, " & strSlot
strWhere = strWhere & " FROM Part_Voltage"
strWhere = strWhere & " WHERE (((Part_Voltage.BurnIn_Dat
strWhere = strWhere & "'h'"
strWhere = strWhere & ",20,[Forms]![frm_rpt_Repo
DoCmd.OpenReport "rpt_PartVoltage", acViewPreview, strWhere
Can I use a variable for a field name?
Some other way?
Thanks,
Brooks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brooks