Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    kleaverjr is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2022
    Posts
    53

    Having Issue With a "Pop Up" Form during Form Load of another Form

    OK,



    My code is not the best, but it's the best I can do. I hope not to get into the very specific as to why I need certain events to happen, but if I really need to show he code, this message is going to get extremely long, so I hope explaining what I basically need I can get ideas as to how to fix the problem that is happening.

    During a Form_Load Event for Form REGISTER, the program searches Table SHOW_INFO and if a particular date is not found in the Table, another Form "SET-UP" pops up so the new show info can be added to the Table SHOW_INFO before the rest of the Form Load Event for Form REGISTER finishes.

    I can't seem to have the Form SET-UP stay open and able to enter the data before the Form Load event ends. Is there a way to pause the Form Load Event so this other Form can be used to input the data and then after that form is done, go back to the Form_Load Event to finish up?

    Thanks

    Ken L

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Open the Form SET-UP in "Dialog" mode
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    kleaverjr is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2022
    Posts
    53
    OK, that solution works, but now I can't get the acDialog form to close automatically. I want to be able to select from a combo box (which works fine) and the last line of code I have in the combobox_click "event" the following:

    DoCmd.Close acForm, "Form_Register_Show_SetUp", acSaveNo

    But the SET-UP form still is there and the REGISTER Form does not automatically appear.

    Thanks for all the help!

    Ken L

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    The acSaveNo is only if you open the form in Design mode, which you are not doing. So get rid of that.
    If that code is in form SetUp, then you can just use Me.Name.
    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. #5
    kleaverjr is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2022
    Posts
    53
    Me.Name results in Invalid Use of Property Error. What am I doing wrong?

    I also deleted the acYes/No, with the DoCmd.close acForm line, and the line runs, but the form still doesn't close.

    Ken L.

  6. #6
    Info@MsAccess.nl is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2022
    Posts
    7
    Quote Originally Posted by kleaverjr View Post
    Me.Name results in Invalid Use of Property Error. What am I doing wrong?

    I also deleted the acYes/No, with the DoCmd.close acForm line, and the line runs, but the form still doesn't close.

    Ken L.
    you can’t use Form_Formx as form name, Form_ is already used in the vba editor to reference to a form.

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Upload the DB with enough to be able to replicate, with instructions on how to do so.
    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

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by Info@MsAccess.nl View Post
    you can’t use Form_Formx as form name, Form_ is already used in the vba editor to reference to a form.
    Actually you can do this. The VBE just prefixes with another Form_ e.g. Form_Form_FormX and the code till works.
    However, just because you can do something doesn't mean you should do so.
    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

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Just looking for naming conventions and came upon this
    https://software-solutions-online.co...g-conventions/

    Sadly some would take that and run with it.
    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

  10. #10
    kleaverjr is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2022
    Posts
    53

    Stupid Me...

    Quote Originally Posted by Info@MsAccess.nl View Post
    you can’t use Form_Formx as form name, Form_ is already used in the vba editor to reference to a form.
    The Form itself is named Register_SetUp, I thought I had to include "Form_" as that is what is listed in the VBA Editor under the Microsoft Access Class Objects List. I deleted the reference to "Form_" and it seems to now work!

    Thanks everyone. Sorry for troubling you. :-( As one of my best friends says, I know just enough to get myself in trouble when it comes to programming, even though I have been doing some form of computer programming starting in 1981 when I was 6 years old on a Apple II computer! I can only imagine trying to create a program this complex having to use line reference numbers for everything! YIKES!

    Ken L.

  11. #11
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    That was not even the name of the form name you 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

  12. #12
    kleaverjr is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2022
    Posts
    53
    I was using the name "REGISTER" as a placeholder so I can type the questions faster. The actual full name of the Form was "Register_SetUp". In the future I will post actual parts of the code to prevent any confusion. Sorry about that. :-\

    Ken L

  13. #13
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Fair enough in your initial post, but in the post with the code you had Form_Register_Show_SetUp?

    Always best to copy and paste.
    We have had people type it all again and not show the true picture.
    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

  14. #14
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    FYI - Form_Something can be a valid reference, such as when referring to a procedure in another db, or sometimes is required if calling a procedure from the immediate window. IIRC that would be when the procedure is not public in scope.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    kleaverjr is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2022
    Posts
    53
    OK,

    I don't know what I did, but now when I execute this line of code, the form itself comes up, but the Form_Load does nothing. This is a different form, but same concept. I need it to pop up to input the data requested then return to the original form.

    Everything was working fine before. I have been debugging some code for this form, but not in the Form_Load section.

    I know Form_Load is not coming up because when I do a trace, after the DoCmd line is done it goes to End Sub and not goes to Form_Load.

    Any thoughts.?

    Ken L.


    Private Sub cmdAddItem_Click()

    DoCmd.OpenForm "Register_Manual_Entry_Item", WindowMode:=acDialog

    End Sub

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

Similar Threads

  1. Replies: 4
    Last Post: 11-14-2019, 11:30 AM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 7
    Last Post: 12-21-2014, 08:21 PM
  4. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  5. Replies: 7
    Last Post: 02-23-2012, 07:19 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