Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run existing code from new click event? 1

Status
Not open for further replies.

merlynsdad

Programmer
Nov 18, 2010
175
US
Is it possible, without changing the name of an existing sub which does NOT run from a click event, to run that sub from a new click event?

If the square peg won't fit in the round hole, sand off the corners.
 
How?

If the square peg won't fit in the round hole, sand off the corners.
 
merlynsdad,
Do you have any sample code you would suggest for us to work with? Give us an example and someone will help. What is at least the name of your existing sub and how about the name of the clicked control?

Duane
Hook'D on Access
MS Access MVP
 
Private sub someNewControl_click()
myOldSub
end sub

private sub myOldSub()
'code
end sub
 
The existing sub is named Public Sub cmdLogon_AppendUserInfo(). The new click event is named Public Sub btnRunAppendDatabase_click().

If the square peg won't fit in the round hole, sand off the corners.
 
merlynsdad,
Any comment on your attempt to implement MajP's suggestion? He gave you the correct answer to your question so I would expect you to at least try it and report back with the results and/or questions.

Duane
Hook'D on Access
MS Access MVP
 


I think he expects merlyn.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Sorry, I'm in training all day for something else, and haven't had a chance to do anything on this.

If the square peg won't fit in the round hole, sand off the corners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top