Solved

In a vba module - call an event within a opened Access form

Posted on 2011-02-20
3
588 Views
Last Modified: 2013-11-28
Per the following code and following URL:

http://www.tek-tips.com/viewthread.cfm?qid=1638344&page=1

I'm trying to add to my knowledge and attempt to call the event from another form called frmDash (WHICH DOES NOT HAVE A SUBFORM AT ALL).  Thus I have to adjust the syntax.

The event called txtColor_DblClick itself is also described below which is directly comes from frmDash itself.

How may I adjust the syntax on Dash4 to get this to work?
'modDash has...

Public Function Dash4()
On Error GoTo Err_This

  If IsOpen("frmDash") = False Then DoCmd.OpenForm "frmDash"
  
  Call Forms("frmDash").Controls("txtColor").Form.txtColor_DblClick
  'Call Change_Color_Dash
  'Call forms("form name").controls("subform control name").form.ProcedureName
  
Exit_This:
  Exit Function

Err_This:
  Call Error_Action(Err, Err.Description, "modRibbon @ Dash3", Erl())
  Resume Exit_This

End Function

'frmDash has...
Public Sub txtColor_DblClick(Cancel As Integer)
On Error GoTo Err_This
  Call Change_Color
Exit_This:
  Exit Sub
  
Err_This:
  Call LOG_ERROR(Err, Err.Description, "frmDash @ txtColor_DblClick", Erl())
  Resume Exit_This
End Sub

Open in new window

0
Comment
Question by:stephenlecomptejr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34939238
try

Form_frmDash.txtColor_DblClick
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34939248
correction, you will need an argument

Form_frmDash.txtColor_DblClick(0)  

0
 
LVL 1

Author Closing Comment

by:stephenlecomptejr
ID: 34942216
Sincere thanks.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question