I have a form that has cascading listboxes. The first one lists incident numbers and the second one is for name that are associated with the selected incident number. The form has testboxes that are populated via code from the query on the second textbox. I have a command button to add incident numbers. When this button is clicked, a form opens up and you input the information and then the form closes. The new incident number is there and the name is there but when you select the name to input the pertinent data, the textboxes on the form get populated with data....The textboxes should be blank. If I close the form and reopen it, the boxes are blank. Here is a snippet of the code I use.
Private Sub lstCDCNum_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
' check this above code if needed***
rs.FindFirst "[ID] = " & Str(Nz(Me![lstCDCNum], 0))
'If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.txtIncidentDate = Me.lstCDCNum.Column(8)
Me.txtCDCNum = Me.lstCDCNum.Column(1)
Me.txtName = Me.lstCDCNum.Column(2)
Me.txtEthnic = Me.lstCDCNum.Column(4)
Private Sub lstCDCNum_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
' check this above code if needed***
rs.FindFirst "[ID] = " & Str(Nz(Me![lstCDCNum], 0))
'If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.txtIncidentDate = Me.lstCDCNum.Column(8)
Me.txtCDCNum = Me.lstCDCNum.Column(1)
Me.txtName = Me.lstCDCNum.Column(2)
Me.txtEthnic = Me.lstCDCNum.Column(4)