Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jul 2007
    Location
    North Carolina, USA
    Posts
    71
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Macro SetValue (2003)

    I call a macro from a form, the macro opens another form and uses SetValue to transfer entries from the 1st form to the 2nd form.
    When I Use SetValue in my Macro for:
    Item: [Forms]![Frm1stFORM]![FieldA] Expression: =[Forms]![Frm2ndFORM]![FieldA]
    It works perfectly. But when I try to fill in a field that is text/memo with a text response it errors out.
    Item: [Forms]![Frm2ndFORM]![FieldB] Expression: ="This is my data"

    I am able to create an expression on the form itself which will allow this, but I don't know how to call it from the Macro.
    Any suggestions on this one? Thanks for everyone's help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro SetValue (2003)

    Set the expression to

    "This is my data"

    instead (without an = in front of it)

  3. #3
    Star Lounger
    Join Date
    Jul 2007
    Location
    North Carolina, USA
    Posts
    71
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Macro SetValue (2003)

    Thanks Hans, that was my problem, it works perfectly without the =.

  4. #4
    Star Lounger
    Join Date
    Jul 2007
    Location
    North Carolina, USA
    Posts
    71
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Macro SetValue (2003)

    Hans, I have another twist on this. If I want the expression to act like a parameter query [What name?] can I do this in the Macro and have it take the entered value and use it in the SetValue expression?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro SetValue (2003)

    Enter the following in the Item parameter:

    InputBox("What Name?")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •