Re: a question in VB6

From: Joe \ (joe_at_bftsi0.UUCP)
Date: 04/12/04

  • Next message: Charles Richmond: "Re: Basic programming Question?"
    Date: Sun, 11 Apr 2004 18:04:21 -0700
    
    

    "Basel Saba" <bg-saba@scs-net.org> wrote in message <news:c99d4f3e.0404111639.77b81764@posting.google.com>...

    > Can I call a procedure in a form from a procedure in another form?
    >
    > I mean:
    >
    > If I have a sub such as: "Private Sub Command1_Click:" in Form1, and
    > in this procedure I want to call another sub such as "Private Sub
    > Command2_Click:" in form2.
    >
    > Can I do that?

    Yes, if Command2_Click is Public instead of Private. However, this
    probably isn't a good idea. Try separating the functionality out
    into a Public Sub within a module and have both Command1_Click and
    Command2_Click call the Public Sub within the module. Otherwise,
    you might find yourself in the same messes that plagued many a VB1
    project.

    -- 
    Joe Foster <mailto:jlfoster%40znet.com>  Sacrament R2-45 <http://www.xenu.net/>
    WARNING: I cannot be held responsible for the above        They're   coming  to
    because  my cats have  apparently  learned to type.        take me away, ha ha!
    

  • Next message: Charles Richmond: "Re: Basic programming Question?"

    Relevant Pages

    • RE: jpgs not showing on forms
      ... Rather than embed the pictures in the database store the paths to the JPEG ... Private Sub cmdAddImage_Click ... Dim strAdditionalTypes As String, strFileList As String ... Private Sub cmdDeleteImage_Click ...
      (microsoft.public.access.gettingstarted)
    • Re: Newbie problem: Long list of user choices
      ... Private Sub Form_DblClick ... Private Sub VScroll1_Change ... Dim cnt As Long ... With Picture1 ...
      (comp.lang.basic.visual.misc)
    • Re: webBrowser control
      ... Dim DoNotExitWeArePrinting As Boolean ... Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ... Private Sub ScreenToAbsolute ... ' When it is simulating this click, this window MUST be the only window ...
      (microsoft.public.vb.general.discussion)
    • Re: Form behaviour when called from toolbar button
      ... Sub EditFind() ... Private Sub cmdBuiltIn_Click ... Dim hwnd As Long ... Dim ret As Long ...
      (microsoft.public.word.vba.general)
    • RichTextBox and multi-level Undo
      ... I recently needed a multi-level undo feature for my editor module, ... What I've read suggests that you need two stacks: ... Private Sub Form_Load ... Private Sub Form_Unload ...
      (microsoft.public.vb.controls)