+ Reply to Thread
Results 1 to 6 of 6

To Call 2 macros

  1. #1
    Registered User
    Join Date
    11-13-2006
    Location
    Sydney Australia
    Posts
    4

    To Call 2 macros

    Hi all,
    i couldnt find anything relating to this in previous threads & was wondering if anyone could shed somelight on this.

    I have a macro that builds a TimeSheet. [named AutoWrecker]
    I have another macro that is a User Input form [named frmEmployeeDetails]

    When i run the form , you input a name & hours worked & it sends the data to
    the TimeSheet. Easy.

    but i now have to make a macro named 'startup' , that will call both of these macros.
    not knowing much about this, i just assumed it was:

    Sub Startup()
    Call AutoWreckers
    Call FrmEmployeeDetails.Show
    EndSub

    This obviously opens both the macros, but there in no longer communication between them. When data in inputted now, it is no longer sent to the timesheet.
    Is anyone able to clarify what i need to add ?.
    Thanks in advance

    napalm

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You will need to post your code for the 2 macros so that we can see why it is failing

  3. #3
    Registered User
    Join Date
    11-13-2006
    Location
    Sydney Australia
    Posts
    4
    Right, sorry about that.
    napalm



    Autowreckers TimeSheet
    Please Login or Register  to view this content.
    Code for Input Form
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Code looks ok to me

    How are you running your macro?
    If it is from a button on a sheet you may have the properties for the button set to takefocusonclick = true instead of = false

  5. #5
    Registered User
    Join Date
    11-13-2006
    Location
    Sydney Australia
    Posts
    4
    orginally i just made a macro saying

    Please Login or Register  to view this content.
    When i opened the sheet, i then clicked on 'run macro' in the Visual Basic toolbar & selected OpenfrmEmployeeDetails()

    This popped up the form & away i went.

    Now i'd like to call the macros, to build the timesheet & run the form, from one macro.

    Thanks

  6. #6
    Registered User
    Join Date
    11-13-2006
    Location
    Sydney Australia
    Posts
    4
    ahhh
    dont worry about me.
    Just realised i was calling the wrong macro.
    i had 'another' macro that 'opened' the input form.
    so
    the solution was

    Please Login or Register  to view this content.
    ahh it was so simple its stupid
    Thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1