Solved

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

Posted on 2011-02-20
3
578 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
  • 2
3 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
try

Form_frmDash.txtColor_DblClick
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
correction, you will need an argument

Form_frmDash.txtColor_DblClick(0)  

0
 
LVL 1

Author Closing Comment

by:stephenlecomptejr
Comment Utility
Sincere thanks.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now