You need to use ADO method.
In your references you need to tick the 'Active X Data Objects' library
You can then use the ADODC control to access your database.
You need to use some code like this on the Form Load event:
Private Sub Form_Load()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data_ Source=C:\YourDB.mdb;"
.Open
End With
Set rs = New ADODB.Recordset
rs.Open "Table name", cn, adOpenKeyset, adLockOptimistic, adCmdTable
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\yourDb.mdb;"
.CommandType = adCmdTable
.RecordSource = "Your table"
.Refresh
End With
End Sub
You then need to put a text box on your form
Set its data source to ADODC1 and set its data field to the field you want to look at.
If you database is secured you will need to add the system.mdw folder to the connection string.
Post back if you need more help.
[This message has been edited by Nero (edited 04-17-2002).]
[This message has been edited by Nero (edited 04-17-2002).]