Re: Can I pass OpenArgs to multiple instances of the same form?



As you found, using the New keyword to open a form does not give you the option of OpenArgs, so you will be looking for alternate approaches.

Calling a generic function in Form_Open or Form_Load sounds fine. If you need the value after those events, perhaps you could use a hidden unbound text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Max Moor" <maxmoor@xxxxxxxxxxxxxxxxxx> wrote in message
news:Xns9B4CA06FCE9ACmaxmoorhotmailcom@xxxxxxxxxxxxxxxx

I've got a form I want to open multiple copies of. It will have a
subform like a checkbook register that displays different accounts' entries
from a general ledger. For example, the general ledger may have entries for
two accounts: Bank1 and Bank2. I want to be able to open a Bank1 register
form and a Bank2 register form at the same time, using the same base form.

I've been reading up on how to manage multiple instances of a form.
Allen Browne has a nice write up using a collection and the hWnd value to
keep track of the various instances.

Is there a way to pass OpenArgs when instanciating a form with the New
keyword?

If not, I considered opening each form hidden, then calling some public
interface function that I could pass the filter info to. That function would
finish the forms setup and make it visible. Is there a better method than
this that is safer or better practice?

Thanks & Regards,
Max

.



Relevant Pages

  • Re: Register keyword and "as if" rule...
    ... its way to take a full 10 minutes every time a "register" declared ... Then my compiler is still C compliant, ... keyword if they want their code to run smoothly on all implementations: ... Optimization hints in general are not nearly so important as they were ...
    (comp.lang.c)
  • RE: Internet Keyword System..
    ... The Chinese mainland has been pursuing domestic technologies rather than ... Those who failed to register ... Subject: Internet Keyword System.. ... Internet Keyword Service was launched by CNNIC (China ...
    (Security-Basics)
  • Re: Keyword register
    ... register storage class, whether the compiler ignores the hint or not. ... > An implementation taking it into account means that the keyword helps it ... In general, a programmer, particularly an applications ... It is in fact much like any other source code optimization. ...
    (comp.lang.cpp)
  • Keyword register
    ... It was advised in this newsgroups that we should avoid the use of ... C++ compilers in my platform ignore this keyword. ... Also the use of register provides the additional guarantee that we do ... implementation to optimise the variable access further, ...
    (comp.lang.cpp)