there are 2 ways to open a table in Access
DAO and ADO
ADO is newer and preferred casue the code is transferable to WEB pages using VBScript
In Access 2000 you have to specify which by opneing VBA editor an clicking on the "Tools" menu the "References"
and "Check" either one as shown below
DAO refernce = "Microsoft DAO 3.6 ....."
-------------------
Dim db as database, rst as recordset, SQL as string
Set db = CurrentDb
' SQL string.
SQL = "SELECT * FROM yourtabler WHERE yourfield = " & Somevalue
Set rst = db.OpenRecordset(SQL)
rst.movefirst
rst.close
db.close
-------------
reference = "Microsoft ActiveX Data Objects 2.1" (or higher)
ADO
--------
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection ' <<<<Note same as CurrentDb
Dim Rs1 As ADODB.Recordset
Dim SQLCode As String
SQLCode = "SELECT * FROM [STOCK CODE LOOKUP] WHERE STOCK_CODE = '" & Me![Part Number] & "';"
Rs1.Open SQLCode, cnn, adOpenStatic, adLockOptimistic
DougP, MCP
Visit my WEB site
to see how Bar-codes can help you be more productive