K
KC_Cheer_Coach
I have a search form where the user will choose data via drop downs before
hitting the "view" button, which displays the results in a subform. I have to
be able to hit the "export" button and send only the results displayed on the
subform to excel. I have been all over the internet, my Access 2003 book, and
the MS Communities trying almost everything I have come across.
I ended up creating a qry that will pull in the data from the main form
based on what the user chose. The problem is that if the user doesn't choose
anything, the qry returns one blank row. I modified the qry to encompass the
possibility of nothing being chosen and now I receive a msg that the
expression is too complex to be evaluated. I can export the results of the
qry to excel, but I am unable to build the qry. Am I on the right track? This
is what I have right now:
SELECT tblAllRuns.[RUN NBR], tblAllRuns.SYSTEM, tblAllRuns.CYCLE,
tblAllRuns.TASK, tblAllRuns.ASSIGNEE, tblAllRuns.VALUE, tblAllRuns.HOURS,
tblAllRuns.MIN, tblAllRuns.TOTAL
FROM tblAllRuns
WHERE ((((tblAllRuns.[RUN NBR])=[Forms]![frmReports]![cboRun]) OR
((tblAllRuns.[RUN NBR])="")) AND
(((tblAllRuns.SYSTEM)=[Forms]![frmReports]![cboSystem]) OR
((tblAllRuns.SYSTEM)="")) AND
(((tblAllRuns.CYCLE)=[Forms]![frmReports]![cboCycle]) OR
((tblAllRuns.CYCLE)="")) AND
(((tblAllRuns.TASK)=[Forms]![frmReports]![cboTask]) OR
((tblAllRuns.TASK)="")) AND
(((tblAllRuns.ASSIGNEE)=[Forms]![frmReports]![cboAssignee]) OR
((tblAllRuns.ASSIGNEE)="")) AND
(((tblAllRuns.VALUE)=[Forms]![frmReports]![cboValue]) OR
((tblAllRuns.VALUE)="")));
Thanks!
hitting the "view" button, which displays the results in a subform. I have to
be able to hit the "export" button and send only the results displayed on the
subform to excel. I have been all over the internet, my Access 2003 book, and
the MS Communities trying almost everything I have come across.
I ended up creating a qry that will pull in the data from the main form
based on what the user chose. The problem is that if the user doesn't choose
anything, the qry returns one blank row. I modified the qry to encompass the
possibility of nothing being chosen and now I receive a msg that the
expression is too complex to be evaluated. I can export the results of the
qry to excel, but I am unable to build the qry. Am I on the right track? This
is what I have right now:
SELECT tblAllRuns.[RUN NBR], tblAllRuns.SYSTEM, tblAllRuns.CYCLE,
tblAllRuns.TASK, tblAllRuns.ASSIGNEE, tblAllRuns.VALUE, tblAllRuns.HOURS,
tblAllRuns.MIN, tblAllRuns.TOTAL
FROM tblAllRuns
WHERE ((((tblAllRuns.[RUN NBR])=[Forms]![frmReports]![cboRun]) OR
((tblAllRuns.[RUN NBR])="")) AND
(((tblAllRuns.SYSTEM)=[Forms]![frmReports]![cboSystem]) OR
((tblAllRuns.SYSTEM)="")) AND
(((tblAllRuns.CYCLE)=[Forms]![frmReports]![cboCycle]) OR
((tblAllRuns.CYCLE)="")) AND
(((tblAllRuns.TASK)=[Forms]![frmReports]![cboTask]) OR
((tblAllRuns.TASK)="")) AND
(((tblAllRuns.ASSIGNEE)=[Forms]![frmReports]![cboAssignee]) OR
((tblAllRuns.ASSIGNEE)="")) AND
(((tblAllRuns.VALUE)=[Forms]![frmReports]![cboValue]) OR
((tblAllRuns.VALUE)="")));
Thanks!