Results 1 to 4 of 4
  1. #1
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194

    Refresh the query that the current form is based on (after change)

    Hey ppls,


    pretty basic idea but im having trouble with the coding.

    Table: [Stock]

    I have a form based on Query: [NegStock] (which shows all stock items with value <0 and ignore is no)

    with field
    [ignore] (yes/no)

    The form is looking at one record at a time.

    I have a next record and previous record button .

    What I want is to click ignore to YES and then go to next record but if I click back... that record is no longer there as it was selected as YES....

    I have tried requerying the form and refreshing it but no luck at all... how on earth do I achieve this basic routine!!?

    GAngel

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    It sounds like your query is only showing IGNORE = NO.
    If this is the case, then of course your record will vanish.
    you maybe should put a filter in the header, to switch from IGNORE settings.

    me.filter = "[ignore]=" & chkBoxIgnore
    me.filterOn = true

  3. #3
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194
    hey ranman... maybe i was unclear.

    My form works fine. it is showing all the "no" which is what i want. But i i change it to a YES the form still has it there until i close the form and open it again at which point it seems to "re run" the query and now it has seen that the ignore is now yes thus it isnt in the query so no longer in my form.

    What i want is if i go to the next record on the form for the query to re run so that if i go back, all the YES answers are now missing as they arent not part of my criteria (which is just 'no")

  4. #4
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    I would be a little leery about that as it makes undoing an accidental change to "YES" impossible. This could be frustrating to your users.

    If you're willing to accept that however, ranman256's suggestion should do what you want - By resetting the Form's Filter, it should force the Form to rerun the query, which would result in your Record being removed from the Form. You can also try Me.Requery.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-28-2014, 06:36 AM
  2. Replies: 1
    Last Post: 10-22-2014, 12:44 PM
  3. Replies: 8
    Last Post: 05-07-2014, 11:21 AM
  4. Refresh form when values change
    By stevewoo in forum Programming
    Replies: 4
    Last Post: 11-30-2011, 06:54 AM
  5. Query based on current record in form
    By bhsvendbo in forum Queries
    Replies: 1
    Last Post: 06-01-2010, 11:20 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