I have added some vb coding to my access. below are it. In the refrence, I also have added
Microsoft DAO 3.6 Object Libarry,Microsoft ACtivex Data Objects 2.1 Library,Ole Automation, Visual Basic for Application, Microsoft Access 9.0 Object Library.
But at the """"" sign, I get the 'type mismatch ' error.
Dim db As Database
Dim wsp As Workspace
Dim rstemployee As Recordset
Set db = DBEngine.Workspaces(0).OpenDatabase("c:\programming\helpportal\helpportal.mdb")
Set wsp = DBEngine.Workspaces(0)
""""" Set rstemployee = db.OpenRecordset("employees", dbOpenDynaset)
rstemployee.Index = "primarykey"
rstemployee.Seek "=", cmbStaffID.Value
If rstemployee.EOF = True Then
MsgBox "Please Enter Valid Employee Id"
cmbStaffID.SetFocus
Else
txtName.Value = rstemployee.Fields("FName")
txtDesignation.Value = rstemployee.Fields("Title")
txtDepartment.Value = rstemployee.Fields("Dept")
End If
can anyone help....
thanks
Microsoft DAO 3.6 Object Libarry,Microsoft ACtivex Data Objects 2.1 Library,Ole Automation, Visual Basic for Application, Microsoft Access 9.0 Object Library.
But at the """"" sign, I get the 'type mismatch ' error.
Dim db As Database
Dim wsp As Workspace
Dim rstemployee As Recordset
Set db = DBEngine.Workspaces(0).OpenDatabase("c:\programming\helpportal\helpportal.mdb")
Set wsp = DBEngine.Workspaces(0)
""""" Set rstemployee = db.OpenRecordset("employees", dbOpenDynaset)
rstemployee.Index = "primarykey"
rstemployee.Seek "=", cmbStaffID.Value
If rstemployee.EOF = True Then
MsgBox "Please Enter Valid Employee Id"
cmbStaffID.SetFocus
Else
txtName.Value = rstemployee.Fields("FName")
txtDesignation.Value = rstemployee.Fields("Title")
txtDepartment.Value = rstemployee.Fields("Dept")
End If
can anyone help....
thanks