Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046

    Popup and/or modal propties throw "curve ball"

    Experts:

    I need some assistance with, I believe, modifying one form's (or multiple forms') **pop-up** and **modal** properties.

    Attached are two (2) sample database:
    1. Folder "01 Before Process Migration" (contains backend and frontend)
    2. Folder "02 After Process Migration" (contains backend and frontend)

    Before I go any further, I first must give credit to MS-Access expert Colin (Mendip Data Systems) who provided a perfect solution for an automated shut-down routine. Ultimately, this shut-down routine allows the DB admin to "kick out any users" in the event of essential DB maintenance. More info about Colin's process can be found at: https://www.access-programmers.co.uk.../#post-1546375

    That said, allow me to provide a step-by-step guide which shall allow you to follow my current dilemma (issue).

    Scenario for the "01 Before Process Migration" (works as designed):
    1. Open the DB "Backend". Then, open "T903_Admin_DB_Kickout" and ensure the boolean value [Kickout] is FALSE (i.e., not checked).
    2. Open the DB "Frontend" via CTRL-Shift. Then, **re-link** the table "T903_Admin_DB_Kickout" (in backend) to the front-end.
    3. Close/re-open the frontend and open normally (without CTRL-Shift). Start-up form "F105_N1S_LogoutTimer" should be displayed.
    4. Check "Kick out N1S Database User". Then click "Execute".
    5. At this time, you'll get a warning message (F105_N1S_LogoutStatus). You can either click "Ok" or "Quit".
    5a. Now, if you click "Quit", Access will completely shut down.
    5b. Alternatively, if you click "Ok", the form "F105_N1S_LogoutStatus" will disappear; however, it will re-appear after 30 seconds. **
    **: Note: In my actual DB solution, I will have the form re-appear every 60 seconds. For testing purposes, however, I changed the interval to every 30 seconds.
    6. Now, the user can continue to either click "Ok" and have the form keep on disappearing/re-appearing until timer reaches 0:00. Then, the session is terminated.

    Again, allow me to re-iterate. This solution was provided by Colin and it works perfectly. I merely customized the form layout (colors, images, etc.) to better mimic my organization.

    So far so good... now, I migrated these three (3) forms into my database. Next, allow me to provide some additional background first before providing the steps which ultimately result in my dilemma/issue.

    Note: As I have a different startup screen, the Load commands had to be slightly changed. Ultimately, after having logged into my database, the shutdown process works exactly the same as in the "Before" example DB.

    Scenario for the "02 After Process Migration" (works as designed but has issues at one point in the process):
    1. Just liked in the "01 Before...", ensure the boolean value in T903_Admin_DB_Kickout" (in backend) is set to FALSE.
    2. Open the DB "Frontend" via CTRL-Shift. Then, **re-link** all four (4) tables in backend to the front-end.
    3. Close/re-open the frontend and open normally (without CTRL-Shift).
    4. You will be prompted enter credentials in the login form. Select "Doe, John"; enter "admin" for the password.
    5. Now, at this time, you will see the "Welcome to the ... Database" main menu.
    6. For testing purposes of the Shutdown process, let's focus on two shortcuts in listbox "Forms" and listbox "Admin".
    6a. Listbox Forms: "View Staff Members"


    6b. Listbox Admin: "System Maintenance (Kick Out DB Users)"
    7. Now, if you click on "View Staff Members" another form (i.e., "F121_N1S_StaffmemberList") will pop up.
    7a. From here, click on the "Open" hyperlink to the left of each staff member's lastname.
    7b. Having clicked "Open" will bring up a secondary form "F122_N1S_Staffmember".
    7c. Note: The process 7a &7b (bring up listform; then open up individual form) is utilized for other scenarios (jobs, organizations, etc.) throughout my actual DB, so I do NOT want to bring up the individual staff member form directly from the hyperlink.

    Process "Alpha" -- this one works great!
    - Click on "System Maintenance".
    - Check "Kick out N1S user..."; then click "Execute" and click "Ok".
    - Do nothing and wait up to 30 seconds.
    - The form "Warning" (F105_N1S_LogoutStatus) re-appears after up to 30 seconds.
    - Click "Ok" again... the forms disappears again. So far so good!!
    - Now, click on "View Staff Members".
    - Do nothing and wait up to 30 seconds.
    - The form "Warning" (F105_N1S_LogoutStatus) re-appears after up to 30 seconds.
    - Click "Ok" again... the forms disappears again. So far so good!!
    - If I keep doing this, eventually I reach timer = 0:00 and the DB shuts down. Great... everything works as expected!!

    Process "Bravo" -- this is where I need some help:
    - First, follow steps 1-4 under the scenario "02 After Process Migration" (i.e., uncheck the boolean value in the table). Otherwise, a "lock form" is presented during log in.
    - You're now back on the main menu.
    - Again, select "System Maintenance" and execute the shut-down procedure.
    - Click on "View Staff Members".
    - Before 30 seconds pass though, click on "Open" of any stafff member.
    - Wait up to 30 seconds.... now, the warning form should, again, re-appear within 30 seconds (while, e.g., looking at "Clint Eastwood" form details).
    - ****Here's the problem now:**** I CANNOT click on either "Ok" or "Quit". That is, even though the warning form sits in front of the staff member form, the two commands button cannot be clicked.
    - Only when I close the form F122_N1S_Staffmember (behind F105_N1S_LogoutStatus) will the two command buttons become clickable.

    In summary, having the two command button NOT clickable will be counter-intuitive/confusing to the user. I can image that many users not know what to do and ultimately let the time run out. This, however, is an issue given that
    the warning form suggests "Please finish your work..." (well, some of them can't because they may not know how to get rid of the warning message).

    All that said, here's my question: Does anyone know how to modify the pop-up/modal properties of any involved form (in this process) so that the two command button will be active when in front of form "F122_N1S_Staffmember"? Alternatively, if the VBA needs to be modified, do you know how?

    Lastly, I will re-iterate that Colin's example works great! However, once implemented into my DB, my process is throwing somewhere a curveball. I spent several hours on this issue but it appears I'm stuck.

    I apologize for this lengthy post but I wanted to illustrate the scenarios in detail IOT "help you, help me".

    Cheers,
    Tom
    Attached Files Attached Files

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    The problem was that you opened your StaffMemberDetaiks form in dialog mode using your macro
    This prevents users doing anything else whilst that form is open ..,as you found out.
    The fix was in fact simple - I removed the dialog mode and changed the form to popup.
    AFAIK it all now works the way you want.

    BTW I recommend you replace the macro(s)with vba procedures
    Attached Files Attached Files
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Hi Tom,

    It is nothing wrong with the warning form, it is the staff member form that is opened by the macro as Dialog, therefore it must be closed before anything else can be clicked. I have changed the embedded macro to open the form as Normal and changed its popup property to True and all works now.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Colin:

    Thank you for the reply... I know you've been busy so I appreciate your coming up w/ a solution in between.

    Allow me to ask a follow-up question (since I need to update other forms as well -- until I had a chance to convert all macros into VBA).
    - In a backup file (well, the one I posted earlier), I tried to replicate the modifications.
    - In form "F122_N1S_Staffmember", I changed pop-up from "No" to "Yes". I tried it then but still didn't work.
    - Now, you mentioned "I removed the dialog mode". I opened macro "SearchStaffMember" in design mode and scrolled down. I visually scanned for "dialog mode" but didn't see it. Obviously, I'm overlooking it.

    My question: Where/how do I locate the "dialog mode" IOT remove it?

    Cheers,
    Tom

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Hi Tom,
    Sorry, Vlad here not Colin, not sure if me is who you are asking this, but I opened your Staff list form in design, went to the OnClick embedded macro of the blue Open pseudohyperlink and in that macro I looked for the OpenForm action - towards the bottom you will see Dialog in yours and Normal in mine.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Clicking Open on a record is form StaffMemberList runs this macro:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	24 
Size:	14.5 KB 
ID:	41220

    The Window mode was set to Dialog - I just cleared that line (and changed it to a popup form)

    In VBA that part of the macro would have been:
    Code:
    DoCmd.OpenForm "F122_N1S_Staffmember",,,"[StaffMemberIDpk]=" & Nz([StaffMemberIDpk],0),,acDialog
    and I would have changed it to:
    Code:
    DoCmd.OpenForm "F122_N1S_Staffmember",,,"[StaffMemberIDpk]=" & Nz([StaffMemberIDpk],0),,acWindowNormal
    or as acWindowNormal is the default, I'd just use:
    Code:
    DoCmd.OpenForm "F122_N1S_Staffmember",,,"[StaffMemberIDpk]=" & Nz([StaffMemberIDpk],0)
    With regard to your other zOrder issue, have you had time to investigate the 2 methods of grabbing users' attention I mentioned?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Sorry for the confusion guys, I didn't realize Colin answered it too just before me!

    Cheer,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Colin - thank you for the additional information. That helped... I changed it to the other processes and it works. **But** as they say: "There is always one... there is always one!" What do I mean by that...

    So, as previously mentioned, I use the same process (i.e., accessing the detail form via the "list" form) for many other processes. I have removed the acDialog for all of them. It now works great except for one.

    I get the error below and I double-checked things left and right (so to speak). Now, when click on "Open" I can't no longer bring up the details for "Billets" (Jobs). Any thoughts as to why the removal of the acDialog would cause an issue w/ the row source?
    Attached Thumbnails Attached Thumbnails Error.JPG  

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    No problem Vlad. Thanks for joining in.

    Tom
    No idea offhand about your 'new issue'. Check whether it is modal and, if so, remove the modal status
    If not that, then I'd need to see that form to investigate further.

    For info, I've just sent a reply to your other thread with what appears to be a solution to the zOrder issue.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  10. #10
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Will do... taking a break from it today. I will keep you posted.

    Also, thank you Vlad for chiming in... much obliged.

  11. #11
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Colin, Vlad:

    I went back and tried (step by step) to determine as to why the BilletList form throws an error once I change the Dialog to Normal property (in the macro). I then created another (trimmed down) demo version that I could post here. Unfortunately, in the short demo version, everything worked fine. Thus, there must be something else in my actual/full Database that causing the error.

    Now, for testing purposes, I converted the macro into VBA. I wanted to see whether or not this could resolve it. I did the conversion of the earlier posted DB that you (Colin) posted back.

    Here are the steps for the conversion:

    Macro to VBA Conversion of form "F123_N1S_BilletList":
    - Opened F123_N1S_BilletList in Design Mode
    - Clicked on "=IIf(IsNull([BilletIDpk]),"(New)","Open")"... then "Properties"
    - Clicked on "Convert Form's Macros to Visual Basic"
    - Unchecked "Include Macro Comments"
    - Click on Convert...
    - Resulted in Error message: "There was a problem opening the macro "Filters". Do you want to continue?
    - Clicked "Yes"
    - Resulted in Error message: "There was a problem opening the macro "Filters". Do you want to continue?
    - Clicked "Yes"
    - Resulted in "Conversion Finished"... clicked "Ok"

    Process "Open Form":
    - Clicked on "Open"
    - Resi;ted om Error message: "TempVars can only store data..."
    - Clicked "Debug"
    - Commented out the 3 lines of the IF statement
    - Returend to form
    - Clicked on "Open"... billet details form opens fine.

    Process "Search Box":
    - Entered, e.g., "Exec" to search box (top right)
    - Resulted in error: "Microsoft Access cannot find the name 'Form' you entered in the expression.

    My questions:
    1. As I commented out the three IF related lines, the Open works ok in this trimmed down version. What is the purpose of the "TempVars"? Do I need them?
    2. After the conversion, I tried using the "Search" box (top right). This one now looks for a form. Now, when using the macro, this never came up. Did the macro conversion not fully succeed?

    Attached are 2 DBs:
    1. "Before..." -- per filename, this is the version that uses the macro.
    2. "After..." -- per filename, this version includes the VBA after macro conversion. This is where the SearchBox in "BilletList" does NOT work any longer.

    Any thoughts?

    Thank you,
    Tom
    Attached Files Attached Files

  12. #12
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Tom
    I'm busy all day today but as you are having difficulties converting the embedded macros to VBA, I would suggest you create new event procedures from scratch.
    Am I correct in thinking the forms with macros are based on one of the MS templates such as Contacts?
    If so, do bear in mind that these are designed to show off features that many developers avoid and are often notoriously difficult to modify.
    I'm sure the tempvars are/were there for a reason. However, I never use them so am not the best person to advise on their use.

    Perhaps someone else will be able to assist if you can't work it out yourself.

    In the meantime, please look at my solution in the other thread where I managed to ensure the Access alert form always appeared above any other open program windows such as Outlook, Word, browser etc.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  13. #13
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Colin:

    Thank you... totally understand. Didn't mean to monopolize for time.

    And, yes, you're absolutely correct. I downloaded the Access Contacts' template. Overall, it's been working great. But at the same time, it's been tricky modifying the macro to make it work.
    Overall, I thought I would have been done w/ the list forms and I pretty much accepted that I ended up w/ macros. Now, however, based on the auto-shut down routine, I have only one list form left where I could NOT change the "Dialog" to "Normal" window property.

    It appears that converting the macro to VBA would have resolved it so that the Locked form appears in front of the detail form; at the same time though, this disabled the search capability.
    As you recommened, I will open up a new/dedicated thread to the macro conversion.

    I'll keep you posted once I found a solution. In the meanwhile, thank you for all of the support you've provided me on the Auto Shutdown process. It really works like a charm.

    Cheers,
    Tom

    P.S. Yes, I looked at your attention seeking examples, including the one you posted yesterday. I'm considering at some of the functionality to my system soon. Thanks again!!

  14. #14
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Colin:

    The issue (macro to VBA) has been resolved. I posted a simplied version of the DB but ultimately, I should be able to now convert/remove all macros from the DB. Thank you for making the recommendation.

    https://www.accessforums.net/showthread.php?t=79937

    I'll do some more testing before cutting over to new version w/o macros, but ultitately I should be go to go (incl. fixing the Dialog to Normal mode).

    Again, thank you for all of your dedicated help... much obliged!!!
    Tom

  15. #15
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Excellent. Glad davegri was able to assist.
    I'm just about to send you a PM....
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 4
    Last Post: 03-23-2015, 09:52 AM
  2. Replies: 2
    Last Post: 11-07-2014, 02:53 PM
  3. Replies: 14
    Last Post: 08-23-2014, 12:35 PM
  4. Createobject.Popup Opens With "okay" Box, Access 2007
    By David92595 in forum Programming
    Replies: 3
    Last Post: 01-17-2013, 02:52 PM
  5. Replies: 4
    Last Post: 01-06-2011, 10:52 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