none
How to: Assign a Field to a TempVar RRS feed

  • Question

  • Hello, anyone/everyone.

    Have searched the Net and can't find answer.

    Maybe it can't be done:

    • Application.TempVars.Add "MyVariable", !CUSTOMER_ID

    Get error:  TempVars only store data.  They cannot store objects.

    !CUSTOMER_ID is a Table Field.

    Is there a way to accomplish the storing of Field values in a TempVar?


    If the directions say go straight, but I turn left, then right: Will I still get there?

    Tuesday, August 23, 2016 3:28 AM

Answers

  • Thanks!

    Your instincts were right.

    Actually, I discovered I had to Type Conversion the Field(s).

    CLng() for my ID's and Cstr() for text, etc.

    I also discovered that Unbound Controls have no Type Conversion requirements.


    If the directions say go straight, but I turn left, then right: Will I still get there?

    • Proposed as answer by David_JunFeng Wednesday, August 31, 2016 1:26 AM
    • Marked as answer by David_JunFeng Wednesday, August 31, 2016 8:38 AM
    Tuesday, August 23, 2016 4:24 AM

All replies

  • Hi. Try adding the Value property. For example:

    TempVars.Add "VariableName", !CUSTOMER_ID.Value

    Hope it helps...

    Tuesday, August 23, 2016 3:58 AM
  • Thanks!

    Your instincts were right.

    Actually, I discovered I had to Type Conversion the Field(s).

    CLng() for my ID's and Cstr() for text, etc.

    I also discovered that Unbound Controls have no Type Conversion requirements.


    If the directions say go straight, but I turn left, then right: Will I still get there?

    • Proposed as answer by David_JunFeng Wednesday, August 31, 2016 1:26 AM
    • Marked as answer by David_JunFeng Wednesday, August 31, 2016 8:38 AM
    Tuesday, August 23, 2016 4:24 AM
  • Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
    Tuesday, August 23, 2016 1:20 PM