Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    Subform is actually a table, It links main table with other table via Autonumber and Number field (relations many-to-many).

    That's my database : (VNOS_POGODBE -1------"infinity"-POGODBA_NADZORNIK-"infinity"------1-NADZORNIK).....So, data from Popup form is sent to table "POGODBA_NADZORNIK", and that table is Subform !

    hmmmm...Do I need to do like this : Forms!VNOS_POGODBE!POGODBA_NADZORNIK.Form.Requery

  2. #17
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    Quote Originally Posted by ItsMe View Post
    Sorry, I typed the subform name incorrectly.

    Forms!VNOS_POGODBE!VNOS_NADZORNIKA.Form.Requery
    I tried that allready and It didn't work, but I will try again, maybe I did It wrong. Will let you know !

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Is the Command Button to open the PopUp form on the MainForm or the SubForm?

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by RuralGuy View Post
    Is the Command Button to open the PopUp form on the MainForm or the SubForm?
    I think the OP is trying to requery the subform from another form, the popup form. My impression is the popup form is updating the table. I was thinking, place some code in the popup form.

  5. #20
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Quote Originally Posted by ItsMe View Post
    I think the OP is trying to requery the subform from another form, the popup form. My impression is the popup form is updating the table. I was thinking, place some code in the popup form.
    I understand but it should not be necessary!

  6. #21
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    My apologies

  7. #22
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Quote Originally Posted by ItsMe View Post
    My apologies
    Not necessary! If the PopUp Form is based on the same table as the SubForm, then unless extraordinary steps are taken, any changes, additions or deletions *will* be saved when the PopUp form is closed and revealed when the SubForm is Requeried.

  8. #23
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    Quote Originally Posted by RuralGuy View Post
    Is the Command Button to open the PopUp form on the MainForm or the SubForm?
    Command button to open the PopUp form is on the MainForm, not SubForm. If you now have answer, could you please post me complete code, and tell me where exactly must I put It ?

    Thanks to both of you, for all your efforts

  9. #24
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    So what you said in your post #5 was not accurate, right?

  10. #25
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    If you could zip up and post your db, we might be able to resolve this issue. Remove any sensitive data of course.

  11. #26
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    If you mean this post.... "No errors. I want to have updated Subform (VNOS_NADZORNIKA) on the main form (VNOS_POGODBE). If I close main form and open again, It updates, otherwise not."....

    ...Than answer is NO. On Subform I have Combine field - this field consists of data from one of the primary keys of table POGODBA-NADZORNIK, and that table links records of main table and table NADZORNIK via primary keys of both.

    So when I enter data on MainForm (which is based on MainTable) and get the autonumber record of It, I click on PopUp form via MainForm. When I enter data there, I create another record in table NADZORNIK. And then, finally, primary key of NADZORNIK and primary key of MainTable (VNOS_POGODBE) get linked in table POGODBA-NADZORNIK. And that table is SubForm which needs to be updated while MainForm is still open, so that I can select data which will link record to Maintable.

    I know that probable cause of all my problems lies in database. It would be simplier If I linked MainTable to table NADZORNIK directly, in relation one to many, but unfortunally this is a school project and my professor demands at least one entity of relation many-to-many. I may have wrong database solution for that, but everything else works

  12. #27
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    When you are dealing with a Many-to-Many relationship, you deal with each side separately.

  13. #28
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Quote Originally Posted by Lukael View Post
    If you mean this post.... "No errors. I want to have updated Subform (VNOS_NADZORNIKA) on the main form (VNOS_POGODBE). If I close main form and open again, It updates, otherwise not."....

    ...Than answer is NO. On Subform I have Combine field - this field consists of data from one of the primary keys of table POGODBA-NADZORNIK, and that table links records of main table and table NADZORNIK via primary keys of both.
    This is the post to which I was referring that appears to be incorrect.
    Code:
    Names of my Forms:  - "VNOS_POGODBE" (main form)
                                 - "NADZORNIK" (popup form)
                                 - "VNOS_NADZORNIKA" (subform in the main form, where change must appear)

  14. #29
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    Quote Originally Posted by RuralGuy View Post
    This is the post to which I was referring that appears to be incorrect.
    Code:
    Names of my Forms:  - "VNOS_POGODBE" (main form)
                                 - "NADZORNIK" (popup form)
                                 - "VNOS_NADZORNIKA" (subform in the main form, where change must appear)
    No, but maybe I was unclear. Correct is : - "VNOS_POGODBE" is main table and name of main form;
    - "NADZORNIK" is table and name of PopUp form;
    - "VNOS_NADZORNIKA" is name of the Subform where change must appear in the main form, and It get's data from table "POGODBA-NADZORNIK"

    And these 3 tables are related as I posted : "(VNOS_POGODBE -1------"infinity"-POGODBA_NADZORNIK-"infinity"------1-NADZORNIK)"

  15. #30
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    Ok, now Ive tried everything you both suggested, on a million ways. Seems like requery method doesn't work on my case, I even changed some database. But I think I know now where problem lies...

    As I told, If I close MainForm and open again (or switch to design view and back) , Combo box in Subform updates, as It should.

    But If the MainForm is open (as It should be), and I enter data in my PopUp form, here's what happens:

    Entered data from PopUp window goes directly in the table, but It doesn't update desired Combo box in Subform because,I think, Combo box's source code is primary key that is same on PopUp form and Subform.

    So, only solution would probably be to close and reopen MainForm after closing PopUp form !

    Any suggestions on how could I do that ? Or even better, to just re-load MainForm after closing PopUp form, so that MainForm wouldn't dissapear from screen ?

    My last post, I promise

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

Similar Threads

  1. popup form
    By Cosmo Monkey in forum Forms
    Replies: 1
    Last Post: 03-25-2013, 03:06 PM
  2. Replies: 1
    Last Post: 02-21-2013, 12:27 PM
  3. Replies: 15
    Last Post: 02-17-2012, 09:20 AM
  4. form popup
    By fabiobarreto10 in forum Forms
    Replies: 30
    Last Post: 01-19-2012, 01:54 PM
  5. Popup Form
    By NISMOJim in forum Forms
    Replies: 1
    Last Post: 10-23-2010, 09:16 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