Results 1 to 6 of 6
  1. #1
    raffi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Location
    Inside a Sub Procedure
    Posts
    88

    Requery Form

    hi, i know the answer to this question is probably a simple one but oh well, is it possible to requery a form by clicking on the tabs posted below ?
    Click image for larger version. 

Name:	Capture.JPG 
Views:	18 
Size:	14.7 KB 
ID:	23775

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    not anywhere i can find. access calls them document tabs.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I was just working with a user that has a form with Tabs. There is a Click event that has
    this code on each of the Tabs (Pages)
    Code:
    Function Refresh()
    On Error GoTo Refresh_Err
    
        DoCmd.RunCommand acCmdRefresh
    
    
    Refresh_Exit:
        Exit Function
    
    Refresh_Err:
        MsgBox Error$
        Resume Refresh_Exit
    
    End Function
    Not sure if addresses your needs.

    See this for more info.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    I've found the Click event to be useless. I use the OnChange event of the Tab control which fires when you change tabs.

  5. #5
    raffi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Location
    Inside a Sub Procedure
    Posts
    88
    this problem was partly solved by the following VBA within the Form Page.

    Code:
    Private Sub Form_Activate()
    Me.Form.Requery
    End Sub
    its requerying subforms within the form but not the combo-boxes i guess i can manually add them one by one by just adding
    Code:
    Me.Cbobox.Requery
    witin the Private Sub shell, o well thx for the reply's time and consideration

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by raffi View Post
    ...its requerying subforms within the form but not the combo-boxes ...
    That's correct...Requerying a Form doesn't Requery its Comboboxes...they have to be done separately.

    If you have a number of them on a Form that have to be Requeried at one time, from the Form's Code Module you can do something like this:

    Code:
    Dim ctl As Control
    
    For Each ctl In Me.Controls
    
           If ctl.ControlType = acComboBox Then
               ctl.Requery 
           End If
    
    Next ctl

    Linq ;0)>

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

Similar Threads

  1. AfterUpdate requery does not requery list box
    By ittechguy in forum Programming
    Replies: 5
    Last Post: 09-05-2017, 08:51 AM
  2. Replies: 7
    Last Post: 07-01-2015, 10:29 AM
  3. Replies: 3
    Last Post: 08-26-2014, 12:52 PM
  4. Replies: 1
    Last Post: 05-26-2014, 10:31 AM
  5. Replies: 2
    Last Post: 10-10-2012, 07:01 AM

Tags for this Thread

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