Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791

    I asked in post 2 if both forms were open. That code suggests neither was open.
    I wouldn't expect it to output even once for a form that wasn't open.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  2. #17
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I wouldn't expect it to output even once for a form that wasn't open.
    Ah, me dummy in assuming that OutputTo implies that form opens first in the process of "outputting". Notice in final code that each iteration shows "Open", "OutputToo" and "Close". Each instance of "Open" in loop configures form for the designated floor as taken from the global variable "strCurFloor". I tested that if "Open" and "Close" sequence done outside of loop that I get 4 copies each of the same 1st floor, which I expected given newly found wisdom from Micron

  3. #18
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Does post #17 answer post #15 question?

  4. #19
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Quote Originally Posted by GraeagleBill View Post
    Does post #17 answer post #15 question?
    Yes also it does answer post #9?
    I would tend to prefix globals with a 'g' to identify them? Then it negates questions on unused variables as it is clear they were defined globally outside the scope of the code posted.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #20
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Then it negates questions on unused variables
    I'd rather that all OP's divulged that information. Don't know if I'd clue in or not since that's not my style. Those who have no clue about scope (lots of code is just copied) won't say because they don't know better. Those who do know should say but for some reason, don't. That just wastes time asking about the not so obvious.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #21
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    prefix globals with a 'g' to identify them
    Great idea. I've always appreciated the conventions of prefixing objects and data types so identifying global variables as such will be a great help.

  7. #22
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Some really good points added to the OP regarding clear variable identification. Since I'm a big user of global variables, perhaps some of my past posts were lacking where I failed to clarify? As posted in #21, I'm adopting Welshgasman's suggestion.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 03-06-2020, 07:20 AM
  2. Outputto PDF cancelled
    By tinyb in forum Programming
    Replies: 12
    Last Post: 10-13-2015, 08:29 AM
  3. modify my outputto command button
    By cuddles in forum Forms
    Replies: 4
    Last Post: 05-14-2014, 05:18 AM
  4. OutputTo PDF???
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 03-17-2011, 11:39 AM
  5. OutputTo Excel
    By smikkelsen in forum Access
    Replies: 0
    Last Post: 03-08-2011, 05:15 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