microsoft access 2010 vba dao recordset findfirst

时间:2015-08-17 19:22:55

标签: vba ms-access-2010 dao recordset

我有一个名为QB的表,其中包含一个字段名称Item。我尝试使用

首先使用find
Dim curDatabase As DAO.Database
  Set curDatabase = CurrentDb
  Set rsQB = curDatabase.OpenRecordset("QB", dbOpenDynaset)

  'This works and equals the value for Item in the first record of the table 
  msgbox (rsQB("Item").Value)

  'Item_No.Value is a string.  The following all do not work:
  rsQB.FindFirst "[Item] = " & Item_No.Value
  rsQB.FindFirst ("[Item] = " & Item_No.Value)
  rsQB.FindFirst "[Item] = '" & Item_No.Value &"'"



  rsQB.Close

0 个答案:

没有答案