How to create call a Module

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesnkk
    New Member
    • Nov 2006
    • 134

    How to create call a Module

    I have many forms, in every form, I need to validate a Process, so instead of coding to every forms, I could think of using module, but not sure how to do it.


    (1). In each form how do I call the module to check the Process and (2) return me the result.

    The result return would allow me to fire up the next form. For example if result return is "Frmcust"
    I would then code frmcust.show


    In the module I use to check the process, but not so sure how to write the
    proper coding.
    Module
    if process = "CUST" then
    frmName="FrmCus t"
    elseif process = "VENDOR" then
    frmName = "FrmVendor"
    elseif process = "STOCK" then
    frmName="frmSto ck
    end if
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    create a procedure and call that where ever you want .

    Comment

    • jamesnkk
      New Member
      • Nov 2006
      • 134

      #3
      Originally posted by debasisdas
      create a procedure and call that where ever you want .
      Do i need to create procedure on every form ?,

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #4
        Originally posted by jamesnkk
        Do i need to create procedure on every form ?,
        Try
        [CODE=vbnet]Module Process_procedu re
        Public Sub(ByVal Cust as Variant)
        Dim Formtoopen as form
        'Your if condition

        Formtoopen.Show
        End sub


        'to call this just type:
        'Replacing Cust with the correct value or :defining it before hand
        Call Process_procedu re(CUST)[/CODE]

        Comment

        • jamesnkk
          New Member
          • Nov 2006
          • 134

          #5
          Originally posted by daniel aristidou
          Try
          [CODE=vbnet]Module Process_procedu re
          Public Sub(ByVal Cust as Variant)
          Dim Formtoopen as form
          'Your if condition

          Formtoopen.Show
          End sub


          'to call this just type:
          'Replacing Cust with the correct value or :defining it before hand
          Call Process_procedu re(CUST)[/CODE]
          Thank You so much will try out

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Originally posted by jamesnkk
            Do i need to create procedure on every form ?,
            No ,create a procedure with Public scope and call it anywhere you want within the project.

            Comment

            Working...