Results 1 to 5 of 5
  1. #1
    jasonbarnes is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2010
    Location
    NC
    Posts
    56

    Correct way to SetProperty with Macro Builder

    When using the macro building with the action, arguments, comments table type setup. What is the proper action to use if I want to make an object such as a button invisible. I thought it would be SetProperty then with the control name visible and value=false.



    However, I get the error with arguments BtnName, 1, False and error number 0.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The action would be SetValue, with an Item like

    [Forms]![FormName]![ButtonName].[Visible]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jasonbarnes is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2010
    Location
    NC
    Posts
    56
    See I couldn't get my Update Queries to run from VBA. Instead, you know when you click the .... on the On Click Procedure... It gives you Macro Builder, Expression Builder, and Code Builder. I did macro builder instead and OpenQuery works fine with my Update query here. SetValue is not an option in the dropdown choices. SetProperty was the closest thing I found. Another part of my problem was the fact I was using Requery after I ran my update too. Therefore if you have a successful way to switch it to VBA I would need the equal syntax to what I was using.

    I've tried CurrentDB.Execute (QryName) and DoCmd.OpenQuery(QryName). Both instances it gives runtime error 3078 and stays it can't find the query. You're pretty good a deciphering my rambling and giving a good solution. Any I missing something with this? And if so which is the best way to call the requery to update my textboxes?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    SetValue is definitely a choice. You may need to click on the Show All Actions icon to see it. I always use VBA code; both of those should work (Execute won't like form references in the query though), but both require the query name as a string:

    CurrentDB.Execute "QryName"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jasonbarnes is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2010
    Location
    NC
    Posts
    56
    That answers a lot of questions.

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

Similar Threads

  1. Expression builder
    By PJ_d_DJ in forum Access
    Replies: 2
    Last Post: 02-24-2011, 03:38 AM
  2. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  3. Epression Builder
    By ehrendreich in forum Programming
    Replies: 1
    Last Post: 12-26-2009, 02:33 PM
  4. Code Builder
    By nkenney in forum Forms
    Replies: 3
    Last Post: 11-04-2009, 10:58 AM
  5. Expression Builder
    By mistaken_myst in forum Access
    Replies: 2
    Last Post: 05-07-2008, 01:30 PM

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