Run time error 3021- no current record

后端 未结 4 1960
天命终不由人
天命终不由人 2021-01-13 01:11

I want to link the result of a query to a Textbox but I get this error: here is my code:

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset(\"SELECT         


        
4条回答
  •  死守一世寂寞
    2021-01-13 01:53

    After trying the solutions above to no avail, I found another solution: Yes/No fields in Access tables cannot be Null (See allenbrowne.com/bug-14)

    Although my situation was slightly different in that I only got the "No current record." error when running my query using GROUPBY, my query worked after temporary eliminating the Yes/No field.

    However, my Yes/No field surprisingly did not contain any Nulls. But, troubleshooting led me to find an associated error that was indeed populating my query result with Null Yes/No values. Fixing that associated error eliminated the Null Yes/No values in my results, thus eliminating this error.

提交回复
热议问题