Results 1 to 15 of 15
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    SetTempVar

    Good Day,



    Can anyone show me how to the value of the tempVar to display its value rather than its name string.

    I have a control 'text1' on a form when a button 'go' on the said form is press the macro assignes SetTempVar the of 'test1'

    Then the next action is for a message box to display the tempVar Value; however it doesn't it displays the string 'test1'

    This is my Macro code:

    SetTempVar
    . Name Year
    . Expression = [test1]
    Message box
    . Message year
    . Beep yes
    . Type none
    . Title

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Please accept my humble apology for violation of the forum rules. I do understand and appreciate you comprehensive explanations for the impact of such a breach. This would not be repeated

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Here you go: [Stareting Date] is a textbox on the form. This embedded macros is the click event of a button on that form.
    Attachment 28278
    Last edited by davegri; 04-15-2017 at 08:29 PM. Reason: clarity

  5. #5
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks for this guidance but unfortunately is doesn't work

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Might be because 'Year' is a reserved word in Access. Try changing the name to tvYear, then like post #4.
    Also, you are setting the tempvar to [test1], but your control is named [text1].
    Last edited by davegri; 04-16-2017 at 01:47 PM. Reason: more

  7. #7
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    I have tried so many different names but this just would work. This matter really needs investigating.

  8. #8
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Are u able to zip your database on here?


    Sent from my iPhone using Tapatalk

  9. #9
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    I have uploaded a simplified version of the Database just to highlight the problem

  10. #10
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    I am sorry; I though the file was uploaded but it hasn't.

    The zip file is being rejected. I am getting a message saying invalid file type. I don't know what I am doing wrong with the uploads

  11. #11
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by George View Post
    I have uploaded a simplified version of the Database just to highlight the problem
    I can not see the uploaded db
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  12. #12
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Sorry I thought it was uploaded but it isn't. I can't get it uploaded. The attachment is rejected; I am getting a message saying that my zip file is an invalid type.

  13. #13
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Here's a complete db which shows that the solution in post #4 does indeed work.
    Attachment 28296

  14. #14
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks davegri. I now understand my issue. You wouldn't believe it: I was missing the = sign in the message box.

    Thanks so very much.

  15. #15
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Details, details. Computers do what we tell them, but the language is on their terms.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums