mdProgrammer
Programmer
Maybe I'm asking or wording this wrong, but how do I loop through the fields that the report uses without running the query again?
I have a report that gets data from a crosstab report for a survey(thus, the fields are dynamic). So, the results might look like this:
Run1: Question1, Question2, Question3
Run2: Question2, Question3, Question7
Run3: Question4, Question5, Question6
What I'm doing right now is I have a function to select the field name from the query, and if it fails, return 0, else return the value of the field. As it stands now, it's running for each possible answer to each question. If it fails, there's a noticable delay before writing to the report. I'm looking for a faster way of doing this. Something like - (in psuedocode)
for each field in report.recordset
if field = fieldName then
' do something
else
'do something else
end if
next
I just don't know how to get the current recordset (assuming that's the right place to look, but dim rs = me.recordset doesn't seem to work) that the report uses.
I have a report that gets data from a crosstab report for a survey(thus, the fields are dynamic). So, the results might look like this:
Run1: Question1, Question2, Question3
Run2: Question2, Question3, Question7
Run3: Question4, Question5, Question6
What I'm doing right now is I have a function to select the field name from the query, and if it fails, return 0, else return the value of the field. As it stands now, it's running for each possible answer to each question. If it fails, there's a noticable delay before writing to the report. I'm looking for a faster way of doing this. Something like - (in psuedocode)
for each field in report.recordset
if field = fieldName then
' do something
else
'do something else
end if
next
I just don't know how to get the current recordset (assuming that's the right place to look, but dim rs = me.recordset doesn't seem to work) that the report uses.