Prev: undo sorts button
Next: Can't Find the Date field
From: jlg via AccessMonster.com on 11 May 2010 12:41 I have a menu form with labels and images. I have highlight and unHighlight code functioning fine (switching images, fonts, etc). All of my labels have _click() events that are currently the standard Private Sub cmdName_click() events that all work correctly. I created a function Function ImageClick (cmdName as string). For each Image, the Click event calls the function =ImageClick("cmdName"). So, when you click the image, it sends the related cmdName and should run its click event. I cannot get it to work. Here is an example of one image and label scenario. Label name = cmdExit Sub cmdExit_click() ...do things before closing Application.Quit End Sub ---------------- Image name = imgExit imgExit onclick Event: =ImageClick("cmdExit") ---------------- Function ImageClick(ControlName As String) Dim menuSub As String menuSub = ControlName & "_Click" Debug.Print menuSub 'follow Click event of related menu item Run (menuSub) End Function ---------------- The debug results in 'cmdExit_Click' which is correct. If I type in cmdExit_Click it works. I have tried EVAL, I have tried CALL and I have tried RUN. What am i missing? I know this can be done. Thanks for ANY suggestions. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1
|
Pages: 1 Prev: undo sorts button Next: Can't Find the Date field |