Requery not executing?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The follwing code is used to change the base query for a listbox, changing
the WHERE clause to a known value, but an examination of the listcount after
the requery confirm that the query returned zero records.

qryStr = "SELECT Master.Part FROM Master ORDER BY Master.Part WHERE
(((Master.Part)=" & """" & qrystr1 & """" & "));"
MsgBox qryStr 'confirms the known value
Me.Part.RowSource = qryStr
Me.Part.Requery
recs = Me.Part.ListCount
MsgBox recs 'returns zero
MsgBox Me.Part.Value 'is NULL

Can someone please suggest a solution?
Remember that the where clause contains a known value, confirmed by using
the same query as the original RowSource.

Thanks.
 
qryStr = "SELECT Master.Part FROM Master ORDER BY Master.Part WHERE
(((Master.Part)=" & """" & qrystr1 & """" & "));"

The query is a bit redundant isn't it? It'll just return qrystr1 if it
exists and nothing if it doesn't.

What are you really trying to do?

B wishes


Tim F
 
Back
Top