1

I have been trying to open a contracts form from contracts_all page. I want to open all the records on the contracts_all form but only show the specific one clicked on. To show this one particular record, the button uses ID found in the contracts_all form. I have managed to go this far with the help of various people in different forums but now I am getting an error which says "Compiler error; Method or data member not found".. Please help! Thanks in advance.

Dim Rs As Recordset
Dim Test As Integer
Dim varBookmark As Variant
DoCmd.OpenForm "Contracts"

Set Rs = Forms!Contracts.RecordsetClone
    Rs.FindFirst ("[ID] = '" & Me![ID] & "'")
varBookmark = Rs.Bookmark
 Forms!Contracts.Form.Bookmark = varBookmark

If Rs.NoMatch Then
  MsgBox "That does not exist in this database."
Else
End If
4

3 に答える 3

1

交換してみる

Rs.FindFirst ("[ID] = '" & Me![ID] & "'")

Rs.FindFirst ("[ID] = '" & Forms!contracts_all![ID] & "'")

少しずれているかもしれませんが、アクティブなフォームが contract_all から Contracts に変更されたため、Me! を使用できなくなったためだと思います。参照。

于 2013-06-11T20:54:20.123 に答える
-2

もう 1 つの可能性は、クリアしようとしているフィールドが日付または数値形式に設定されていることです。たとえば、私のデータベースではそうでした。しかし、このトピックに関する多数のスレッドを見て、多くのことを学びました!

于 2015-06-24T12:50:03.597 に答える