View Full Version : rowsource in query for Report EITHER from here OR from there... possible?


wiklendt
04-29-2008, 05:28 PM
hi,

before i vernture out to create a series of reports for my database, i wanted to make sure i was going to go about it the right way (i'm a fairly new to access)

i have a database, with tables and forms already constructed as i want them.
for purposes of this example, they are:

custom switch: with combo box allowing user to select and individual, then buttons to invoke things like data entry forms and (eventually) a cascading combo to select session dates (for the individual selected in the first combo) and view and print reports of that session.

data entry form: to enter data on individual and session (session data is a sub form in individual form).

what i want/plan to do:

build a query with what i want to have in the report, and have the individualID and sessionID sourced from the combo boxes in the switch.

but i also want the user to have the choice of previewing a report as they are writing it (just by clicking a "preview report" button in the session subform to see how it's comming together so far, NOT a real-time update of text as they are typing).

so, i was thinking to have the source IDs in the query to be an IIF statement to essentially say: "IF the switch is open, get the IDs from this ELSE take it from the session subform" (the switch is ONLY open when nothing else is).

with the right code, will this work? and am i going about it the right way? or is my direction with this all wrong?

i'd be happy just to have the cascading combo's invoke the report from the switch only, which, from what i've read, is VERY simple, i think i can handle it on my own, but my partner (whom i'm building the ddb for) would like to be able to check how the report looks without exiting the data entry form to do it - and it makes user-friendly sense, of course.

cheers,
agnieszka.