L
Luke Dalessandro
Hi Everyone,
*Using Access 2000*
Summary: How do I pass/reference a Menu Item's "Parameter" variable
into/inside a Macro to pass it to a function (using "RunCode") that
takes a string parameter, or how do I call the function directly from
the Menu Item without using the Macro?
Thanks,
Luke
*************************************************
** More detail to describe the situation below **
*************************************************
Brief table description:
MainRecords(MainRecordID, ...)
Events(EventID, MainRecordID, Type, Date, User, ...)
There is a one-to-many relationship between the two tables on
"MainRecordID".
There are a bunch of different types of events that can occur for a
record. Entry of event data is controlled by popup "data entry" forms.
So as a simple example, two types of events are "Called" and "Closed."
My two forms would be named "Event_popCalled" and "Event_popClosed."
I have a module procedure that pops forms for me based on a passed
string form name.
Public Function Event_AddEvent(strPopFormName as String) As Boolean
DoCmd.OpenForm strPopFormName
Event_AddEvent = True
End Function
The actual situation is more complicated, but this demonstrates my question.
I have a Menu that has an "Event" menu group. Within the group I have
menu items that corerespond to the different events available.
Events
Add Call
Close Record
From the "Add Call" and the "Close Record" Menu Items I want to call
Event_AddEvent("Event_popCalled")
Event_AddEvent("Event_popClosed")
Respectively.
When I set the Menu Item's command to "Event_AddEvent" directly, it
can't find the function (it's looking for a callback function?), so I
created a macro that has one line: "RunCode". I point run-code at my
"Event_AddEvent" function, which works fine.
My problem is that I can't figure out how to reference the Menu Item's
"Parameter" variable (set to the form name) inside the Macro to pass it
to my function... I don't want to have one macro per Menu Item because
it gets too cluttered. Any help would be great.
Thanks in advance,
Luke
*Using Access 2000*
Summary: How do I pass/reference a Menu Item's "Parameter" variable
into/inside a Macro to pass it to a function (using "RunCode") that
takes a string parameter, or how do I call the function directly from
the Menu Item without using the Macro?
Thanks,
Luke
*************************************************
** More detail to describe the situation below **
*************************************************
Brief table description:
MainRecords(MainRecordID, ...)
Events(EventID, MainRecordID, Type, Date, User, ...)
There is a one-to-many relationship between the two tables on
"MainRecordID".
There are a bunch of different types of events that can occur for a
record. Entry of event data is controlled by popup "data entry" forms.
So as a simple example, two types of events are "Called" and "Closed."
My two forms would be named "Event_popCalled" and "Event_popClosed."
I have a module procedure that pops forms for me based on a passed
string form name.
Public Function Event_AddEvent(strPopFormName as String) As Boolean
DoCmd.OpenForm strPopFormName
Event_AddEvent = True
End Function
The actual situation is more complicated, but this demonstrates my question.
I have a Menu that has an "Event" menu group. Within the group I have
menu items that corerespond to the different events available.
Events
Add Call
Close Record
From the "Add Call" and the "Close Record" Menu Items I want to call
Event_AddEvent("Event_popCalled")
Event_AddEvent("Event_popClosed")
Respectively.
When I set the Menu Item's command to "Event_AddEvent" directly, it
can't find the function (it's looking for a callback function?), so I
created a macro that has one line: "RunCode". I point run-code at my
"Event_AddEvent" function, which works fine.
My problem is that I can't figure out how to reference the Menu Item's
"Parameter" variable (set to the form name) inside the Macro to pass it
to my function... I don't want to have one macro per Menu Item because
it gets too cluttered. Any help would be great.
Thanks in advance,
Luke