Thank John for taking the time to look at my issue.
I just realized I never said that this is an Access 2010 database.
can you explain to me what is happening in my code - when I step thru
it I come to the line in Form_Load **Me.lstPlanes.Selected(0) = True**
and flows right into **Private Sub lstPlanes_Click()** that is why i
thought setting the selected property fired the click event.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Option Compare Database
Private Sub Form_Load()
'***********************************
'*
'*
'***********************************
On Error GoTo Err_FormLoad
Me.lstPlaneNames.RowSource = ""
Me.lstPlanes.RowSource = ""
Me.lstSites.RowSource = ""
Me.lstSubPlaneNames = ""
Me.lstSubPlanes.RowSource = ""
Me.lstPlanes.RowSource = "SELECT DimensionalPlaneNames.PlaneName,
DimensionalPlaneNames.PlaneId FROM DimensionalPlaneNames WHERE
DimensionalPlaneNames.TrueName = True AND
DimensionalPlaneNames.SubPlaneId Is Null ORDER BY
DimensionalPlaneNames.PlaneName;"
Me.lstPlanes.Selected(0) = True
Exit_FormLoad:
Exit Sub
Err_FormLoad:
MsgBox "(" & Err.Number & ")- " & Err.Description, vbOKOnly,
Me.Name & " Form_Load"
Resume Exit_FormLoad
End Sub
Private Sub lstPlanes_Click()
'***********************************
'*
'*
'***********************************
Const strPlaneSQL1 As String = "SELECT Alignment.AlignmentTitle,
DimensionalPlane.Color, PlaneType.PlaneTypeDescription,
DimensionalPlane.Active FROM PlaneType INNER JOIN (DimensionalPlane
INNER JOIN Alignment ON DimensionalPlane.AlignmentId =
Alignment.AlignmentId) ON PlaneType.PlaneTypeID =
DimensionalPlane.PlaneType WHERE DimensionalPlane.PlaneId = "
Dim clsHldSQLCall As ADOWrapper
Dim strRecordSetArray() As String
On Error GoTo Err_lstPlanesClick
Me.lstPlaneNames.RowSource = "SELECT
DimensionalPlaneNames.PlaneName, DimensionalPlaneNames.TrueName,
DimensionalPlaneNames.PlaneId, DimensionalPlaneNames.PlaneNameId FROM
DimensionalPlaneNames " & _
"WHERE DimensionalPlaneNames.SubPlaneId
Is Null And DimensionalPlaneNames.PlaneId = " & Me.lstPlanes.Column(1,
Me.lstPlanes.ListIndex) & " ORDER BY DimensionalPlaneNames.PlaneName;"
Me.lstPlaneNames.Requery
Me.lstPlaneNames.Selected(0) = True
Set clsHldSQLCall = New ADOWrapper
clsHldSQLCall.SQLStatement = strPlaneSQL1 & Me.lstPlanes.Column(1,
Me.lstPlanes.ListIndex)
strRecordSetArray() = clsHldSQLCall.LoadData()
Set clsHldSQLCall = Nothing
Me.txtPlaneAlignment.Value = strRecordSetArray(1, 1)
Me.txtPlaneColor.Value = strRecordSetArray(1, 2)
Me.txtPlaneType.Value = strRecordSetArray(1, 3)
Me.chkPlaneActive.Value = strRecordSetArray(1, 4)
Me.lstSubPlanes.SetFocus
Me.lstSubPlanes.RowSource = "SELECT
DimensionalPlaneNames.PlaneName, DimensionalPlaneNames.PlaneId,
DimensionalPlaneNames.SubPlaneId FROM DimensionalPlaneNames " & _
"WHERE DimensionalPlaneNames.TrueName =
True And DimensionalPlaneNames.SubPlaneId Is Not Null And
DimensionalPlaneNames.PlaneId = " & Me.lstPlanes.Column(1,
Me.lstPlanes.ListIndex) & ";"
Me.lstSubPlanes.Requery
Me.lstSubPlanes.Selected(0) = True
Exit_lstPlanesClick:
Exit Sub
Err_lstPlanesClick:
MsgBox "(" & Err.Number & ")- " & Err.Description, vbOKOnly,
Me.Name & " lstPlanes_Click"
Resume Exit_lstPlanesClick
End Sub
Private Sub lstSubPlanes_Click()
'***********************************
'*
'*
'***********************************
On Error GoTo Err_lstSubPlanesClick
Me.lstSubPlaneNames.SetFocus
Me.lstSubPlaneNames.RowSource = "SELECT
DimensionalPlaneNames.PlaneName, DimensionalPlaneNames.TrueName,
SubDimensionalPlane.PlaneId, SubDimensionalPlane.SubPlaneId,
DimensionalPlaneNames.PlaneNameId FROM DimensionalPlaneNames INNER
JOIN SubDimensionalPlane ON (SubDimensionalPlane.PlaneId =
DimensionalPlaneNames.PlaneId) AND (DimensionalPlaneNames.SubPlaneId =
SubDimensionalPlane.SubPlaneId) WHERE SubDimensionalPlane.PlaneId = "
& Me.lstSubPlanes.Column(1, Me.lstSubPlanes.ListIndex) & " AND
SubDimensionalPlane.SubPlaneId = " & Me.lstSubPlanes.Column(2,
Me.lstSubPlanes.ListIndex) & ";"
Me.lstPlaneNames.Requery
Me.lstSubPlaneNames.Selected(0) = True
Me.lstSites.SetFocus
Me.lstSites.RowSource = "SELECT Sites.SiteId, Sites.SubPlaneId
FROM Sites WHERE Sites.SubPlaneId = " & Me.lstSubPlanes.Column(2,
Me.lstSubPlanes.ListIndex) & ";"
Me.lstSites.Requery
Me.lstSites.Selected(0) = True
Exit_lstSubPlanesClick:
Exit Sub
Err_lstSubPlanesClick:
MsgBox "(" & Err.Number & ")- " & Err.Description, vbOKOnly,
Me.Name & " lstSubPlanes_Click"
Resume Exit_lstSubPlanesClick
End Sub
++++++++++++++++++++++++++++++++++++++++++++++++++++++
i am now not sure what is going on with the click event firing if it
is not because of the selected property
Hoping you have time
Thanks