Results 1 to 4 of 4
  1. #1
    LesaM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    2

    Cool Changing via a macro a text box property in a subform

    I need help in setting the text box property in an MS Access 2010 subform that had previously worked in the 2007 version. But, before I go any further let me say, I cannot use VBA in my development (a departmental restriction).
    Originally the following macro setup generated a “control name ‘D1’ is misspelled or…” error:
    If [Forms]![priAddS_Grid]![LvlGrpDesc]="Sup/Prem/Disc" then
    SetProperty
    Control Name: D1
    Property: Visible
    Value: 0


    End If

    (In the above, I’m using the primary form’s combo box value “Sup/Prem/Disc” to set the subform’s text box (D1) property)

    I’m getting around the control name error by changing my macro to the following:
    If [Forms]![priAddS_Grid]![LvlGrpDesc]="Sup/Prem/Disc" then
    GoToControl
    Control Name: frmS_GridIncCdLvlHiRate
    GoToControl
    Control Name: D1
    SetProperty
    Control Name:
    Property: Visible
    Value: 0
    End If

    But, the text box continues to be visible after the macro has run. The focus is in the D1 text box, but the property is unchanged.

    Thank you in advance of any help that you can send my way.

    Lesa

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,942
    What event runs this? Cannot set control that has focus to Not Visible or Not Enabled.

    The issue that needs to be resolved is why the macro is not finding the named control.

    Do you want to provide project for analysis?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    LesaM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    2
    June7,
    You may be right that the macro isn't finding the control to change the property. But the system isn't giving an error messge to confirm this problem.

    Regarding you question on what event runs my macro.

    The macro is triggered after an update of a combo box in the main form.

    I'm new to this site and don't understand what you're asking here...Do you want to provide project for analysis?

    Thanks again.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,942
    You can attach the project (or other files) to post. Make copy, remove confidential data, run Compact & Repair, zip if large. The Attachment Manager is below the Advanced post editor.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Dirty property for Text Box
    By tylerg11 in forum Forms
    Replies: 6
    Last Post: 04-07-2015, 11:02 AM
  2. Replies: 2
    Last Post: 11-27-2011, 07:08 PM
  3. Replies: 7
    Last Post: 10-03-2011, 12:44 PM
  4. Visible property in subform columns
    By MDB in forum Forms
    Replies: 3
    Last Post: 09-03-2011, 06:46 PM
  5. Changing Text colour on value amount
    By stu_C in forum Forms
    Replies: 1
    Last Post: 08-08-2011, 06:58 AM

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