A way to call more than one event at a time if the action is the same?

johnkrytus

Registered User.
Local time
Today, 14:44
Joined
Mar 7, 2013
Messages
91
Is there a way to call Events from multiple controls at the same time (assuming the action is the same)?

Code:
Private Function OpenPeopleNavigator() As String '--Open the People_Edit popup in the Company Contacts View Page
    Dim stDocName As String, stlinkCriteria As String
    stlinkCriteria = "[EmployeeID]=" & Me![qry_people_not_merged.EmployeeID]
    DoCmd.OpenForm "People_Enter", acNormal, , stlinkCriteria, acFormEdit
End Function

Private Sub ctrl_dates_DblClick(Cancel As Integer)
    Call OpenPeopleNavigator
End Sub

Private Sub ctrl_email_DblClick(Cancel As Integer)
    Call OpenPeopleNavigator
End Sub

Private Sub ctrl_notes_DblClick(Cancel As Integer)
    Call OpenPeopleNavigator
End Sub

Private Sub ctrl_phone1_DblClick(Cancel As Integer)
    Call OpenPeopleNavigator
End Sub
 
Last edited:
To answer your exact question--No. An event is an event--the occurence of some action, don't think about it as a computer term but as a generic term. An event is the occurence of an action--picking your nose, painting a house, bending over, kicking a soccer ball are all events.

All of your events are double clicks on different objects. You can't double click on 4 things at once, so no you cannot achieve multiple events at once, especially 4 different double clicks on different objects.

Functions and Subs are sets of codes which for all practical purposes can be run simutaneously.

Can you explain what you want to occur?
 
I was just going for less code on the page. In other words
If the user clicks on any of the following controls, then do this event

I knew it was silly but I don't know what I don't know so I thought I'd ask.

Code:
Private Sub ctrl_dates_DblClick(Cancel As Integer), ctrl_email_DblClick(Cancel As Integer), ctrl_notes_DblClick(Cancel As Integer), ctrl_phone1_DblClick(Cancel As Integer)
    Call OpenPeopleNavigator
End Sub
 

Users who are viewing this thread

Back
Top Bottom