Dynamic Form & Report Names

  • Thread starter Thread starter JeffP->
  • Start date Start date
J

JeffP->

Details: I want to take the switchboard CmdArg F_MyForm,YM. I can parse into
two strings; sFormName = "F_MyForm", sAction="YM" as reportCode
I want to open the value of sFormName and pass in YM somehow.

My code in F_MyForm determines the report name from the YM from the
T_Reports tbl, as well as that it's Year & Manufacturer.

Stuck at: Trying to open a dynamically named form and passing in a value,
I've tried setting the Filter value to sAction, which if it would pass in I
could ADO to the T_Reports and get my report name, change the dropdown labels
to Year & Manufacturer and know what lookup values to assign to both.

Yes, One form many reports....

Any clues, links or tips woud be appreciated.

TIA
 
I don't use Macros or the Switchboard, so I am not sure how it could be from
there, but in VBA, you can pass a value to a form using the OpenArgs argument
of the OpenForm method. Then in the form's Load event, you can capture the
value and do what you need with it.
 
Klatuu,

I'm not the project mgr, but I got over my brain lapse and added a public
var to pass in the other info, I bound the report name to the button event as
the switchboard's Arg and then using the public var (reason being that the
same form produces many reports depending on the selected switchboard
button), which in turn determines from the t_reports table what the drop down
labels and their data sources are. The reason for this is that the project
mgr is barley an Access pgrmmr (well actually not at all) and she dosent'
want to have to go to me or another programmer. This is my way of doing a bit
of coding that will enable her to make many reports and not have to get me to
program a form for each one.
 
Back
Top