The "on action" command does not pass the ribbon object, but just runs any
standard vba "PUBLIC" function you have..
So you On Action should be:
<button id="cmdOrders" label="Orders" onAction="=onOpenForm()"
note the additon of the = and also the ()
(the ribbion is quite picky in this regards).
So, now in a standard public module (or the the current forms module if you
want)
you then go:
Public Function onOpenform
end function
Of couse in your example you trying to use the "tag", and you don't need to,
just pass the value as a string right from the buttion like:
eg:
<button id="cmdOrders" label="Orders" onAction="=onOpenForm('Orders')"
In the above, we are passing 'Orders' to our routine, so:
Now, we would modify our code to :
Public Function onOpenform(strForm as string)
docmd.OpenForm strForm
end function
So, don't bother with the tag idea, just pass whatever form to that function
as string like above.
You can also use the same idea for reports....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)