execute a line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user888
    New Member
    • Jul 2006
    • 6

    execute a line

    Hi! Does anyone how to make Access execute a line, something like this:
    "me." & me.activecontro l.name & ".value = " date()

    so, does anyone understand what i want and does anyone know how i can do it?

    thanx for the help
  • user888
    New Member
    • Jul 2006
    • 6

    #2
    "me." & me.activecontro l.name & ".value = " date()
    that line should lokk more like
    "me." & me.activecontro l.name & ".value = " & date()

    however i still don't know how to make it work.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32668

      #3
      Try :
      Code:
      Me.ActiveControl = Date()
      :)

      Comment

      • user888
        New Member
        • Jul 2006
        • 6

        #4
        Tanx for the reply, but i don't need this to happen for the active control. Any other ideas?
        I want to have a variable for example MyVariable = "Me.Text15"
        I want to able to do sth like
        MyVariable & ".Value=" & some value here
        Now i want to execute this and i have no idea how.
        text15 is not the active control.

        Is it more clear now what i want to do? Can it be done in Access? I used sth like that in FoxPro some time ago, but i have forgotten exactly how it was done. And I never discovered how to do it in Access.

        Thank you all for the help.

        Comment

        • user888
          New Member
          • Jul 2006
          • 6

          #5
          I guess in my first post the example i have given was not right. I don't need the active control but any control I have chosen in VBA above. I'm sorry I don't explain right what I need to do, I hope now I'm more clear about my problem.

          Comment

          • Tanis
            New Member
            • Mar 2006
            • 143

            #6
            More information on exactly what you are trying to do might help. Incidentally,My Variable = Me.TextBox will put what's in the textbox into MyVariable. No Quotation marks needed.

            Comment

            Working...