Results 1 to 9 of 9
  1. #1
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66

    Simple Requery Structure - Continous Forms

    I have been in the same rut for about two weeks now. I am losing patience with a requery. It should be easy as elementary, but it is beating me down.



    My form name is SEARCH and it is a continuous form.
    The field I would like to sort is [BUSINESS NAME]

    I speculate that the VBA would consist of a
    DoCmd.Requery.________

    **This is for a text box entry. "Begins with" format
    Last edited by JeffG3209; 06-05-2011 at 07:16 PM. Reason: **

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have never used DoCmd.Requery but the syntax would be:
    DoCmd.Requery "control name here"

    I have used:
    Me.Requery
    Form_formname.Requery
    Me.controlname.Requery
    Form_formname.controlname.Requery

    See http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    requery or OrderBy? not clear from your post. Sounds like you want to change the form's OrderBy property and then refresh.

    maybe helpful.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Just reread original post. Is not clear if want to filter, sort, or goto record. Post complete procedure code if still need help.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    Quote Originally Posted by June7 View Post
    Just reread original post. Is not clear if want to filter, sort, or goto record. Post complete procedure code if still need help.
    I would like to Filter a continuous form using a text box.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    So in code behind the main form, in some event such as a button Click or textbox AfterUpdate, refer to the subform container and its Form, like:

    I know these three lines will work together.
    Me.subformcontainername.Form.FilterOn = False
    Me.subformcontainername.Form.Filter = "fieldname=" & Me.textboxname
    Me.subformcontainername.Form.FilterOn = True

    This might work, I haven't tried it yet.
    Me.subformcontainername.Form.Filter = "fieldname=" & Me.textboxname
    Me.subformcontainername.Form.Requery
    Last edited by June7; 06-10-2011 at 07:21 PM. Reason: fix syntax in examples
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by June7 View Post
    So in code behind the main form, in some event such as a button Click or textbox AfterUpdate, refer to the subform container and its Form, like:

    I know these three lines will work together.
    Me.subformcontainername.Form.FilterOn = False
    Me.subformcontainername.Form.Filter = Me.textboxname
    Me.subformcontainername.Form.FilterOn = True

    This might work, I haven't tried it yet.
    Me.subformcontainername.Form.Filter = Me.textboxname
    Me.subformcontainername.Form.Requery
    And make sure to change subformcontainername to the actual name of your subform control (the control on the parent form which houses the subform, but it isn't the subform itself)

    (I just threw that in just in case because I've had people take even that as literal. )

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Oh, and if you use Me.TextBoxNameHere you still have to pass the filter with the field name as something like:

    Me.subformcontainername.Form.Filter = "[Business Name Field] = " & Chr(34) & Me.textboxname & Chr(34)

    or else it won't work.


    (and you don't need the
    Me.subformcontainername.Form.Requery
    part)

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Thanks, Bob. Looks like I forgot to complete the criteria expression in my examples so did an edit of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-23-2011, 07:11 AM
  2. Simple forms/queries question (I hope!)
    By Remster in forum Access
    Replies: 6
    Last Post: 09-07-2010, 12:08 PM
  3. Checkbox in continous form
    By senthilrg in forum Access
    Replies: 11
    Last Post: 12-05-2009, 08:49 AM
  4. Horitontal Continous Form?
    By Lawrence in forum Forms
    Replies: 1
    Last Post: 07-21-2009, 03:06 PM
  5. Requery?
    By CO711 in forum Forms
    Replies: 0
    Last Post: 08-06-2008, 08:03 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