Results 1 to 2 of 2

Thread: calling procedures

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Post


    I have a simple form with two lables and two text boxes with a data control at the bottom of the form to step through a data base that i have.
    The code i have works if placed directly in the data control, but i want to place it in a standard module and call it from the first module.
    Prviate Sub Data1_ Valadate(Action as Integer, Save As Integer)
    Call Module1.Update
    End Sub
    NOW I HAVE THIS IN A STANDARD MODULE
    Sub Update()
    If Save = True Then
    If MsgBox(" Are you sure that you want to make these changes", vbYesNo + vbDefaultButton2 + vbQuestion)= vbNo Then
    Save = False
    End If
    End If
    End Sub
    Thanxxxxxxxx.

  2. #2
    Member
    Join Date
    Jan 1999
    Location
    Garden Grove, CA, Orange
    Posts
    55

    Post

    Hi,

    Code:
     
    Prviate Sub Data1_ Valadate(Action as Integer, Save As Integer)
    '0 is evaluated as False and other than zero are True
    
    If Save then 'If value of the Save is not zero
    If MsgBox("Are you sure that you want to make these changes", vbYesNo + vbDefaultButton2 + vbQuestion)= vbNo Then 
    'Do Cancel Procedure
    Else 
    Update 'u don't need to reference module name just call the procedule
    End If
    Else 'If value of the Save is zero
    'Don't Save
    End if
    End Sub
    
    In the Module,
    Public Sub Update()
    'Do Update Procedure
    End Sub
    HTH
    Joon


    [This message has been edited by jpark (edited 11-02-1999).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width