Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,869
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Call a Function From a Variable?

    I have the following in Form and it works OK

    Call RunForm("frmProviderLookup", "", "Edit", "", "", "Normal", "Normal")

    I want to build a combo box with several different RunForm variations as follows:

    RunForm("frmProviderLookup", "", "Edit", "", "", "Normal", "Normal")
    RunForm("frmCustomerLookup", "", "Edit", "", "", "Normal", "Normal")
    RunForm("frmVendorLookup", "", "Edit", "", "", "Normal", "Normal")
    etc, there are many of these

    When I select one the variations from the combo box the RunForm statement is stored in strAction varaible

    How do I code the Call strAction line? (I want only one call statement)

    In other words how to call a Function from a variable

    The start of my module Function works OK and looks like this:

    Public Function RunForm(FormName As String, _
    Optional WhereCondition As String = "", _
    Optional xMode As String = "", _
    Optional filterName As String = "", _
    Optional Args As String = "", _
    Optional WindowMode As String = "", _
    Optional View As String = "")

    ' Parameters (all optional except parameter 1)
    ' 1 - Form Name
    ' 2 - Where condition
    ' 3 - Mode [Add, Edit, View(Read Only), ""(PropertySettings), DS(Datasheet Edit)]
    ' 4 - Filter Name
    ' 5 - Opening Arguments
    ' 6 - Window Mode
    ' 7 - Form View

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,869
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Call Eval(strAction)

    Thanks to theDBguy &

    HansV Eileen's Lounge

Posting Permissions

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