Solved

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

Posted on 2011-02-20
3
586 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 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

766 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