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 / May 2008

Tip: Looking for answers? Try searching our database.

Linked combos not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chris.edwards20@googlemail.com - 28 May 2008 08:55 GMT
I have a form with a tabbed area in the lower part to accommodate
different categories of data. One tab has two combos cboJobGroup and
cboJobSubgroup. The rowsource property in cboJobSubgroup includes
reference to the value of cboJobGroup so that only appropriate values
for the Job Group are offered.

I am using the following code to ensure that only valid combinations
are chosen

Private Sub cboJobGroup_Dirty(Cancel As Integer)
   'clear Job subgroup if job group is changed
   Me!cboJobSubgroup.Value = Null
End Sub

Private Sub cboJobGroup_AfterUpdate()
   'requeries subgroup combo to update the rowsource property with
the value entered for the JobGroup in this combo
   Me!cboJobSubgroup.Requery
End Sub

But it doesn't work (although I think it did when I originally set it
up). To double check that I hadn't made some error in the code I added
a temporary command button on the tab which does the same things as
the above

Private Sub Command137_Click()
  Me!cboJobSubgroup.Value = Null
  Me!cboJobSubgroup.Requery
End Sub

Clicking it does have the expected effects. It would appear that the
AfterUpdate and the Dirty events are not occuring as expected as the
code attached to these does not appear to be run. I can't see why this
is - has anyone got any light to throw on the problem?
Chris
chris.edwards20@googlemail.com - 28 May 2008 10:47 GMT
On May 28, 8:55 am, chris.edward...@googlemail.com wrote:
> I have a form with a tabbed area in the lower part to accommodate
> different categories of data. One tab has two combos cboJobGroup and
[quoted text clipped - 31 lines]
> is - has anyone got any light to throw on the problem?
> Chris

Since posting I have discovered that the property sheet for
cboJobGroup did not have [Event Procedure] against the AfterUpdate and
the Dirty events although the code was still there in the VBA view. By
clicking on the dots at the righthand end of the property on the
property sheet and choosing codebuilder which took me to the
appropriate VBA code then returning to the property sheet [Event
Procedure] now appears and the events do trigger the code. How is it
that the code can be there but doesn't appear to be linked to the
properties? As it was working once it must have become detached
somehow. Is there something I am doing wrong which has caused the to
occur?
Chris
 
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.