469,601 Members | 2,039 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,601 developers. It's quick & easy.

Problem with Cascading Combo/List Boxes

kcdoell
230 100+
Good Morning:

I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off:

Expand|Select|Wrap|Line Numbers
  1.   Procedure declaration does not match description of event or procedure having the same name. 
Basically have three tables:

One for the Division location:

tblDivision
DivisionID = Autonumber
DivisionName = Text

One for the Segment:

tblSegment
SegmentID = Autonumber
SegmentName = Text

One for the Unique Locations (Many to Many Relationship Tbl):
tblLocationsMM

JtnLocationsID = Autonumber
DivisionIDFK = Number (Foreign Key)
SegmentIDFK = Number (Foreign Key)
WrkRegIDFK = Number (Foreign Key)
CreditRegIDFK= Number (Foreign Key)
BrokerTypeIDFK= Number (Foreign Key)


I followed the cascading script method posted on this website and created a form, put 3 combo boxes on it:

cboDivision (bound on column 1, row source tblDivision, column count set to 2, Column Widths set @ 0";1")
cboSegment (bound on column 1, row source blank, column count set to 2, Column Widths set @ 0";1")
cboWrkReg (bound on column 1, row source blank, column count set to 2, Column Widths set @ 0";1")


In the after update event of my cboDivision I placed the following code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CboDivision_AfterUpdate()
  2.  
  3. 'When the Division is selected, the appropriate Segment list will
  4. 'display in the drop down list of CboSegment
  5.  
  6.    With Me![cboSegment]
  7.      If IsNull(Me!cboDivision) Then
  8.         .RowSource = ""
  9.       Else
  10.         .RowSource = "SELECT DISTINCT tblSegment.SegmentID, " & _
  11.          "tblSegment.SegmentName " & _
  12.          "FROM TblLocationsMM INNER JOIN tblSegment " & _
  13.         "ON TblLocationsMM.SegmentIDFK = tblSegment.SegmentID " & _
  14.          "WHERE [DivisionIDFK]=" & Me!cboDivision
  15.       End If
  16.      Call .Requery
  17. End With
  18.  
  19. End Sub
  20.  
Any ideas why I am getting an error? Any ideas would be helpful.

Thanks,

Keith.
Jun 16 '08 #1
1 2333
kcdoell
230 100+
I solved this one, no need to reply.....

I had another cascading code where the definition event procedure was the issue:

Private Sub cboSegment_AfterUpdate(Cancel As Integer)

Changed to:

Private Sub cboSegment_AfterUpdate()

That is what happens when you copy your old code to something new.......

Thanks,

Keith.
Jun 16 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by cognoscento | last post: by
6 posts views Thread by visionstate | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.