Where do you get the data for Me![AccountCode] ?
The search code refers to Text23.Text and Me.lstdata.Column(1)
If Text23.Text = Me.lstdata.Column(1) Then
Me.txtsearch2.SetFocus
stLinkCriteria = "[txtsearch2]=" & "'" & Me![AccountCode] & "'"
DoCmd.OpenForm FrmWorkfile1, , , stLinkCriteria...