Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help with DIM and using

EwingerKEwingerK Posts: 1Member
Man, I need to re-read all my VBA books & training videos again!

If you can help me with this question I would really appreciate it.

I am wanting to create and populate a variable

Comments

  • DaiMitnickDaiMitnick Posts: 77Member
    How can you have done so much coding without relying on variables? Bizarre. Well I'm guessing it's too late now, but for reference's sake, this is how you declare and assign a value to a variable in VBA:

    [code]
    Dim TheString As String
    TheString = "01"
    [/code]

    More commonly you may want this variable to be something the user enters, which would be:

    [code]
    TheString = InputBox("Input the number here: ")
    [/code]

    Then to use it:

    [code]
    .SourceDataFile = "U:POLL" & TheString & "misc.dbf"
    [/code]

    Hope this helps someone, if not you. Regards, Dai


    ------------------------------------------
    Do or do not, there is no try. |
    ------------------------------------------
Sign In or Register to comment.