none
Set a variable to object with a variable RRS feed

  • Question

  • He
    Dim varName as object
    Dim strName as String
    strName = "Order"
    Set VarName = Forms!strName
    Tuesday, March 13, 2018 6:04 PM

All replies

  • Try:

    Set VarName = Forms(strName)

    Hope it helps...

    Tuesday, March 13, 2018 6:14 PM
  • No, it did not work
    Wednesday, March 14, 2018 9:46 AM
  • Hi mycklebo,

    You had mentioned that,"No, it did not work".

    Does it gave you any error or nothing happen when you implement it?

    Please provide a detail information about how you implement it.

    I try to make a test with the suggestion given by .theDBguy

    I find that it is working on my side.

    You need to make sure that what you are passing as "strName" variable. That form should be available in your database.

    I can see in the original post that you are using "Order" as form name.

    Does Form "Order" is available in your database?

    If not, Then you can try to create a new form with name "Order".

    Let us know about your testing result.

    We will try to provide further suggestions, If issue persist.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 14, 2018 10:00 AM
    Moderator
  • Sorry,  I was wrong it works

    Thanks for the tip


    Wednesday, March 14, 2018 3:02 PM
  • Hi,

    Glad to hear you got it to work. Good luck with your project.

    Wednesday, March 14, 2018 3:12 PM
  • Hi mycklebo,

    From your last post, I can see that your issue is solved now.

    This thread is still open.

    I suggest you to mark the suggestion given by .theDBguy as an answer.

    It will help us to close this thread and It will also be helpful for the community members in future who will have same kind of issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 15, 2018 12:47 AM
    Moderator