Access has the concept of "bound forms". You can create forms that let
the user find, view, add, edit, and delete records, *without any
programming*. I'm no VB expert, but I don't think that VB has bound
forms. So clearly, you approach the job quite differently, when using
Access, compared to VB.
In general, there's no guarantee that a particular programming method
that works with VB, will work correctly - or at all - with Access. In
particular, the code that you have shown so far - taken exactly as you
have written it - will not work in Access, *or VB*.
I suggest that you forget that code, and research the use of "bound
forms" in Access. In particular, check ut the form-level RecordSource
property, and the control-level ControlSource property, in F1 Help.
HTH,
TC (MVP Access)
http://tc2.atspace.com