Results 1 to 10 of 10
  1. #1
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167

    Requery a non pop-up form which is already open and maximize

    Good morning again,



    In my database i have a main form (such as switchboard form) and a lots of command buttons. One of them is the "cmdSearch" which can open the "frmSearch". When i use this command i can open the search form in order to find the customer. Then, i have embedded other command button which is responsible to run a code in order to find the customer from tblCustomers and then to open the "frmCustomers" which must match the CustomeID.

    Everything working fine until the time to re-press the command Search again..! So, If you do that i must find a solution to make requery the frmCustomers which is already active..!!


    Can somebody to help?

    Regards

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Have you tried
    Forms!frmCustomers.Requery

  3. #3
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    Ye but i don't know i take back error...
    please note that, the main from still active (tapform) moreover and the search form the same. The search form is a pop up form...Any idea?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Pop up should not make a difference. I do not understand the releveance of the search form. Requery will requery a form's current recordset and include any filter properties within said requery. If you need to adjust the filter properties or RecordSource of the form, do so before Requery.

    If you have a Modal and Pop Up form then maybe

    Me.Modal = false
    Forms!frmCustomers.Requery
    me.modal = true

    or
    Me.Modal = false
    Forms!frmCustomers.setfocus
    Forms!frmCustomers.Requery
    docmd.close acform, Forms!PopUpFormName

  5. #5
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    I will try to attach a sample in order to check it..By the way thanks for your direct response..

  6. #6
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    This is a sample.

    Waiting your response

    Regards
    Attached Files Attached Files

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    There are some issues with your DB. VBA is not recognizing your form as a form object. Also, there are other issues with your frmCustomers. For instance, the events are not firing correctly. Perhaps you changed how events are handled from saved Macros to VBA and back and forth again. I was able to correct a few issues but there are many issues with the first object I looked at, frmCustomers.

    Recommend rebuilding frmCustomers. Could be corruption in other objects too. Perhaps rebuilding objects in a new DB is appropriate.

  8. #8
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    Dear friend,

    First all i would like to thank you very much for the information you have given. But, I want to mention that I already carry all the database objects to a new access database and i have this results...... I don't know what i can do more..


    Some questions:

    1. VBA is not recognizing your form as a form object
    Can i do something with this issue? I mean its necessary to write a code in order to vba to recognize my frm as an object?

    2. For instance, the events are not firing correctly
    Really i don't know why you find out this issue? If you mean that, there is no correct written commands by me, ok i understand because as i told from the beginning i don't have any programming experiences.. but if the problem is anywhere else on vba installation please let me know..

    Thank you for your time.

    Regards

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The sample you provided me was corrupt. Nothing to do with the VBA per se.

    Events in frmCustomers were not working correctly. By removing them, I avoided getting errors. The error indicates to me that you, at one time, had an embedded macro in the event property.

    My assessment is that the file is corrupt. You may be able to salvage bits and pieces of your original DB. However, importing a corrupt form or even a corrupt control within a form could replicate the problem in a new DB.

  10. #10
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    Thanks again..i will see how can i fix the problems

    Regards

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

Similar Threads

  1. Replies: 15
    Last Post: 04-11-2015, 08:15 AM
  2. Replies: 6
    Last Post: 02-08-2014, 10:04 AM
  3. docmd.maximize (2003 to 2010)
    By redbull in forum Forms
    Replies: 1
    Last Post: 08-02-2012, 05:28 PM
  4. Maximize Switchboard and hide shutter bar
    By Huddle in forum Access
    Replies: 4
    Last Post: 02-27-2012, 08:04 AM
  5. maximize switchboard upon opening
    By zrawe16 in forum Access
    Replies: 4
    Last Post: 05-27-2011, 12:26 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