Results 1 to 10 of 10
  1. #1
    Join Date
    May 2012
    Posts
    89

    Arrow Unanswered: Auto update a Query that is displayed on a form...

    Hi i hope some1 can tel help me with an issue with a db if created, im sort of new to all this...

    the data base is for registration of people who are in the building, and from what time and to what time they are leaving...

    I have a form (mainform) where i have 2 buttons 1 for adding a record when some1 comes in. and 1 button for when some1 gets out.
    Both buttons have textboxes to add time and name ext ext.
    And i have made a query with all the info what i have displayed on a (Sub)form
    Bud when i add a name (record) din or out, the data is not updated on the (query)form to see the data i have put in i need to reopen the mainform...

    [B]-So can some1 tell me how the form what displays the info from the query to be auto updated every time i add some data or some thing similar...
    [B]

  2. #2
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    If you see the results by closing the form and opening it again, then you could try:

    Forms![mainform]![subform].Requery

    (where mainform and subform are the actual names of your forms)

    If you don't see the new entries even after closing and reopening the form then something is wrong in your query

    Steve

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    If its a single user system then doing a me.requery or me refresh should do the job
    if its a multi user system then you may have to use a timer to refresh/requery the underlying data.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    May 2012
    Posts
    89
    Quote Originally Posted by sps View Post
    If you see the results by closing the form and opening it again, then you could try:

    Forms![mainform]![subform].Requery

    (where mainform and subform are the actual names of your forms)

    If you don't see the new entries even after closing and reopening the form then something is wrong in your query

    Nothing is happening if got the code:

    DoCmd.Forms![frmHoofd]![SUBfrmTabelSchoonmaak].Requery

    Bud i dont know if a DoCmd is ok or that its something else.
    And the trigger command what should that be???

  5. #5
    Join Date
    May 2012
    Posts
    89
    Quote Originally Posted by healdem View Post
    If its a single user system then doing a me.requery or me refresh should do the job
    if its a multi user system then you may have to use a timer to refresh/requery the underlying data.
    It is a single user system im not a brain with the the VBA so hope u can spel write it out just a bit...?
    The main form is called "main" the subform with the query is called "SUBfrm1"

  6. #6
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    You would need to add to the event routine that is handling your in/out button clicks. Once inside the sub just add either of the suggestions (and repeat for the other button):

    Forms![frmHoofd]![SUBfrmTabelSchoonmaak].Requery (without the DoCmd)

    or could try the simpler form of me.requery (as suggested above) which will often do the job.

    Steve

  7. #7
    Join Date
    May 2012
    Posts
    89
    Quote Originally Posted by sps View Post
    You would need to add to the event routine that is handling your in/out button clicks. Once inside the sub just add either of the suggestions (and repeat for the other button):

    Forms![frmHoofd]![SUBfrmTabelSchoonmaak].Requery (without the DoCmd)

    or could try the simpler form of me.requery (as suggested above) which will often do the job.
    Its not working i have tried:
    Forms![frmHoofd]![SUBfrmTabelSchoonmaak].Requery
    Bud then i get error msg 2465...???

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    If, as you say

    main form is called "main" the subform with the query is called "SUBfrm1"
    why are you using frmHoofd and SUBfrmTabelSchoonmaak in your code?

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    Join Date
    May 2012
    Posts
    89
    Quote Originally Posted by Missinglinq View Post
    If, as you say



    why are you using frmHoofd and SUBfrmTabelSchoonmaak in your code?

    Linq ;0)>
    Jeah i know sometimes i talk confusing.... bud let me explain it more logic:
    I have a main form called: frmHoofd
    On that form i have a subform called: SUBfrmSchoonmaakHOOFD
    If got a button to open a small single form to add info records to the query them query (called: qrySchoonmaak) is shown in the SUBfrmSchoonmaak (there is an confirmbutton to add the info and close the smaller form this 1 is called: frmSchoonmaakIN

    In the print screen the red text and lines is the explanation.

    Hope you can help....

  10. #10
    Join Date
    May 2012
    Posts
    89
    Hope you can help....[/QUOTE]
    Attached Thumbnails Attached Thumbnails Naamloos.gif  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •