I have a form that has cascading listboxes. The first one lists incident numbers and the second one is for names that are associated with the selected incident number. The form has textboxes 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....(apparently from the first record in the table) The textboxes should be blank. If I close the form and reopen it, the boxes are blank so it appears that the query is working properly. Here is a snippet of the code I use.
when I look in the code window it shows the recordsets are null, but the textboxes get populated with data! Any suggestions?
Code:
Private Sub lstCDCNum_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![lstCDCNum], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.txtConvictDate = rs![Conviction Date]
Me.txtCourtComments = rs![CourtComments]
Me.txtDAAccept = rs![Date DA Accepted]
Me.txtDACaseNum = rs![DA Case Number]