This is basic:
Code:
Option Explicit
Private WithEvents conPhone As ADODB.Connection
Private WithEvents rsDir As ADODB.Recordset
Private Sub Form_Load()
Set conPhone = New ADODB.Connection
Set conDir = New ADODB.Recordset
Cn.CursorLocation = adUseClient
Cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source= " & App.Path & "Phone.mdb"
With rsDir
.Open "Select * FROM Directory", conPhone, adOpenStatic, adLockOptimistic
If .RecordCount > 0 Then
txtTitle = !Title & ""
txtName1 = !Name1 & ""
txtName2 = !Name2 & ""
txtPos = !Position & ""
txtDept = !Dept & ""
txtfloor = !Floor & ""
txtPhone = !Phone & ""
txtFax = !Fax & ""
End If
.Close
End With
End Sub
NOTE:
It would be wise to include a Key in all tables.
e.g. EmployeeCode, a numeric field that increments when you wish to add an employee.