Results 1 to 2 of 2

Thread: CreateEventProc

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: CreateEventProc

    I have the next code to create a form and put a command button on it also
    it writes an Click event to that button. It functions good. What I want is just put that code not in the Click event of that button, but in the Form Open event.
    Thanks

    PHP Code:
       Dim frm As Formctl As Controlmdl As Module
       Dim lngBack 
    As LongbackVal As Boolean
       
        
    ' Neues Formular erstellen.
        Set frm = CreateForm
        
        ' 
    Befehlsschaltfläche auf dem Formular erstellen.
        
    Set ctl CreateControl _ 
          
    (frm.NameacCommandButton, , , , 100010001200400)
        
    ctl.Caption "Click ...."
        
        ' Verweis auf Formularmodul zurückgeben.
        Set mdl = frm.Module
        ' 
    Ereignisprozedur hinzufügen.

    lngBack mdl.CreateEventProc("Click"ctl.Name)
        
    ' Text in den Prozedurrumpf einfügen.
        mdl.InsertLines lngBack + 1, vbTab & _
    "MsgBox ""Hello from ACCE$$ world"""
        
        ' 
    For German Acce$$
        
    ' DoCmd.Save acForm, "Formular2"
        ' 
    DoCmd.OpenForm "Formular2"
        
       ' For English Acce$$
        DoCmd.Save acForm, "Form1"
        DoCmd.OpenForm "Form1"
        
        DoCmd.MoveSize 900, 900, 4000, 3000
        '
    DoCmd.Save acForm"VBLcreated"
        
    backVal True

    Exit_this
    :
        Exit 
    Sub

    Error_this
    :
        
    MsgBox Err " :" Err.Description
        backVal 
    False
        Resume Exit_this 
    Click

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    I can't find a solution.
    Hope someone can.

Posting Permissions

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