Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2008

Tip: Looking for answers? Try searching our database.

Dynamic Form & Report Names

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JeffP-> - 29 Feb 2008 19:37 GMT
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
Klatuu - 29 Feb 2008 20:18 GMT
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.
Signature

Dave Hargis, Microsoft Access MVP

> Details: I want to take the switchboard CmdArg F_MyForm,YM.  I can parse into
> two strings; sFormName = "F_MyForm", sAction="YM" as reportCode
[quoted text clipped - 13 lines]
>
> TIA
JeffP-> - 29 Feb 2008 23:57 GMT
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.

> 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
[quoted text clipped - 18 lines]
> >
> > TIA
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.