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. #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
  •