G
Guest
Is it possible to pass more than one argument to a form via the
DoCmd.OpenForm "MyForm",,,,,,MyArgument
routine?
Thanks
DoCmd.OpenForm "MyForm",,,,,,MyArgument
routine?
Thanks
Ofer said:As much as I know, you can't pass more the one argument.
Instead you can create as many global variables that you need, before
opening the form assign the values to this variables, and you can use them
anywhere else in he DB, its just the same as sending few arguments to the
next form.
Just don't forget to create them in a module.
Is it possible to pass more than one argument to a form via the
DoCmd.OpenForm "MyForm",,,,,,MyArgument
routine?
Thanks
Kevin said:You can, but then you'd have to parse the passed fields. I wasted a lot of
time doing that, early on.
You're probably much better off creating public properties and functions or
subs in the form you want to pass things to, and invoking them from the
calling form:
DoCmd.OpenForm "fzzDBCompare"
Forms!fzzDBCompare.StuffID "From", Me.DBId & ""
invokes the public function (or sub) StuffID in the form fzzDBCompare, and
passes the values "From" and Me.DBId to it. That function (or sub) will do
whatever you told it to do in the fzzDBCompare form, including finding the
first record where the field "From" equals me.DBId. (Assuming the function
or sub does that, of course.)
I'm frankly ashamed that it took me as long as it did to find this really
simple way of doing things, but I'm also kind of, well, call it irritated,
that it took me as long as it has to find it.
Like they say, everything's simple if you know the answer.
HTH,
Kevin
I hadn't seen the split function. Is that a custom function or part of
MS Access? Anybody have comments about which of the three techniques
presented here is faster?
I hadn't seen the split function. Is
that a custom function or part of MS
Access? Anybody have comments
about which of the three techniques
presented here is faster?