Run time error 3021- no current record

后端 未结 4 1965
天命终不由人
天命终不由人 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:55

    One more thing I like to add that may cause this, is your returning a sets of resultset that has "Reserved word" fields, for example:

    Your "Customers" table has field name like the following:

    Custnum  | Date | Custname
    

    we know that Date field is a reserved word for most database

    so when you get the records using

    SELECT * FROM Customers
    

    this will possible return "No Current Record", so instead selecting all fields for that table, just minimize your field selection like this:

    SELECT custnum, custname FROM Customers
    

提交回复
热议问题