?
Solved

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

Posted on 2011-02-20
3
Medium Priority
?
594 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 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

765 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