Results 1 to 5 of 5
  1. #1
    Abacus1234 is offline Competent Performer
    Windows 8 Access 2013 32bit
    Join Date
    Nov 2011
    Posts
    212

    Using Macros to Make subforms invisible, before printing, based on value in subform field

    I have spent hours wrestling with syntax, and getting nowhere. Any comments gratefully received.
    In Macro
    Open Form
    GotoControl FAP Name of subform
    Condition IsNull([Forms]![FCDPage4BS].[FAP].[Form].[APFirstchangeamt] SetProperty [Forms]![FCDPage4BS].[FAP] or FAP or 1st option with .[Form] at the end

    It seems to understand the condition, but not the SetProperty.

    Failing making the above work, I have a button on the main form for each subform, which the user can click on, and the subform becomes invisible.

    I cannot find a way of saying go to the button and click on it, in the macro. Tried Send keys Enter and Click, but not working. I'm opening the database in Access 2007.



    I have a klugey workaround that simply opens the form last when printing a set of five and so the user can make each subform invisible if they are not needed, but .........

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why are you printing Forms instead of Reports?

  3. #3
    Abacus1234 is offline Competent Performer
    Windows 8 Access 2013 32bit
    Join Date
    Nov 2011
    Posts
    212
    Thanks for the question.....

    I'm trying to provide a very quick turn-around for users to enter data and print-out various required forms. I do have all the forms as Word documents, but being able to print the forms is an interim step for fast turnaround for draft documents.I also don't know any reason why I should not print out a form rather than a report.

    I have also found a way around the references to subforms and mainforms not working well. When I get to the problem form, I have the macro go to the command Button, that the user can click on to make the subform invisible, and then I put the on-click code into a ?public? module, and it now works. I wanted to set some defaults in the subform when I open the Main form, but this leaves the cursor in the subform, and I have not found a way of getting it back to the mainform. (I rely on the mantra, that there is always a way, and so many times there is.)

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by Abacus1234 View Post
    I also don't know any reason why I should not print out a form rather than a report.
    A report is *far* more flexible than a Form and is designed to print. A Form has been coerced into printing by MS and not very flexible.

  5. #5
    Abacus1234 is offline Competent Performer
    Windows 8 Access 2013 32bit
    Join Date
    Nov 2011
    Posts
    212
    Thanks for the clarification. I did not know that. Appreciate the response.

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

Similar Threads

  1. Make subform ID fields invisible?
    By snowboarder234 in forum Forms
    Replies: 4
    Last Post: 05-25-2016, 08:04 AM
  2. Make foreign key on subform invisible in form view
    By snowboarder234 in forum Forms
    Replies: 1
    Last Post: 04-04-2013, 01:06 PM
  3. How to make a field invisible in form view?
    By snowboarder234 in forum Forms
    Replies: 3
    Last Post: 10-25-2012, 12:43 PM
  4. Replies: 1
    Last Post: 06-15-2012, 05:08 AM
  5. Replies: 1
    Last Post: 10-05-2011, 04:36 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