Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2005

Tip: Looking for answers? Try searching our database.

Where to put the requery?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dgreen - 13 Jul 2005 20:04 GMT
I have a subform1 that queries projects and supporting data from
various tables. There are 3 text boxes on subform 1 which
are used for a subform2 query to obtain additional information for
a particular project.

The fields on the subform2 are currently text boxes displaying the
results from the subform2 query and need to be converted to
combo boxes.  What they will display is based on what is in the 3
text boxes of subform1. They will be used when entering new records
and will reflect the choices made in subform1.

The comboboxes need to be refreshed with each new record displayed in
subform1.  I've tried putting a requery several places to no avail.
Does the requery need to be on the subform1 property Afterupdate:

This didn't work:
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.cboResponseType.Requery
Me!QueryLettersForm.cboDELIVERY_TYPE.Requery
End Sub

Or on the textboxes of subform1 for each of the new comboboxes
going on subform2?

I've reviewed and tried the reomendations on
http://www.mvps.org/access/forms/frm0031.ht to no avail.  I'm
obvousily missing something and need help to discover what
I'm doing incorrectly.

Thanks for your help!
Conan Kelly - 13 Jul 2005 22:19 GMT
I have a form with a Category ID combo box and a Sub Category ID combo box.
The choices that show up in the Sub Category ID combo box depend on what is
selected in the Category ID combo box.  I put the code to requery the Sub
Category ID in the LostFocus event of the Category ID combo box:

Private Sub cboCategoryID_LostFocus()
   requery_cboSubCategoryID
End Sub

Private Sub requery_cboSubCategoryID()
   If IsNull(cboCategoryID) Then
       Exit Sub
   Else
       mintCategoryID = CInt(cboCategoryID)
   End If
   Me!cboSubCategoryID.RowSource = "SELECT tblSubCategory.SubCategoryID,
tblSubCategory.SubCategory FROM tblSubCategory WHERE _
       (((tblSubCategory.CategoryID)=" & mintCategoryID & "));"
   Forms![frmProducts]![cboSubCategoryID].Requery
End Sub

Private Sub Form_Current()
   requery_cboSubCategoryID
End Sub

I also put the requery in the Current event of the Form

I hope this helps.

>I have a subform1 that queries projects and supporting data from
> various tables. There are 3 text boxes on subform 1 which
[quoted text clipped - 26 lines]
>
> Thanks for your help!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.