Link to home
Start Free TrialLog in
Avatar of tru-numbers
tru-numbersFlag for United States of America

asked on

Auto load beforeUpdate event

I have about 300 text fields to load a function into the beforeUpdate event.  Is there a way to auto load the function in all the desired text fields?
Avatar of andrewssd3
andrewssd3
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you give some more details please?  What are the text felds - do you mean text boxes on a userform, or are they cells in an Excel workbook.  beforeUpdate sounds as if a userform is involved.  What exactly are the functions you want to put in them?  Perhaps you could post the code you already have then it wil be easier for someone to help you.

Stuart
Avatar of tru-numbers

ASKER

Thanks andrewssd3,

Fields are on a userform.  I want to insert
Call getControlInfo(ActiveControl)
to the fieldName_beforeUpdate event

I check the user entry with this code and its' as follows:

    If TypeOf ctrl Is MSForms.Frame Then
        Set getControl = getControlInfo(ctrl.ActiveControl)
   
    ElseIf TypeOf ctrl Is MSForms.MultiPage Then
        Set getControl = getControlInfo(ctrl.Object.SelectedItem.ActiveControl)
   
    Else
        Set getControl = ctrl
        frmProgramAdmin.fldName = ctrl.Name
        frmProgramAdmin.fldValue = ctrl
       
        If validDate(frmProgramAdmin.fldValue) = False Then
            frmProgramAdmin(ctrl.Name) = ""
       
        End If
   
       
        If validNumber(frmProgramAdmin.fldValue) = False Then
            frmProgramAdmin(ctrl.Name) = ""
       
        End If
       
    End If
ASKER CERTIFIED SOLUTION
Avatar of andrewssd3
andrewssd3
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've requested that this question be closed as follows:

Accepted answer: 0 points for tru-numbers's comment #37831970

for the following reason:

I did this in error
Even so, I did give some relevant help with supporting documentation, so it would be good to allocate some points at least rather than just deleting the question altogether.
Thanks