Help with DIM and using - Programmers Heaven

Howdy, Stranger!

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

Categories

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.