J
JHarris
Guest
Hello everybody,
I was hoping to get some feedback. I am using some VB code in Access 2000, trying to add a record to an existing table (ITEM) by using a DAO procedure. My problem is that when I declare my variable dbs as a Database, the Database isn't recognized...why...how do I fix it? The code is below:
Private Sub cmdItemAdd_Click()
On Error GoTo cmdItemAdd_Click_Err
Dim dbs As Database, rst As RecordSet
Set dbs = CuttentDB
Set rst = dbs.OpenRecordset("Item", dbOpenDynaset)
With rst
.AddNew
![Item_Serial] = txtHardSerial.value
:
:
:
.Update
End With
rst.Close
cmdItemAdd_Click_Exit:
Exit Sub
cmdItemAdd_Click_Err
MsgBox Err.Description
Resume cmdItemAdd_Exit
End Sub
Dim dbs AS Database, rst AS RecordSet is causing an error because the data type Database isn't recognized. Isn't this built in?
I was hoping to get some feedback. I am using some VB code in Access 2000, trying to add a record to an existing table (ITEM) by using a DAO procedure. My problem is that when I declare my variable dbs as a Database, the Database isn't recognized...why...how do I fix it? The code is below:
Private Sub cmdItemAdd_Click()
On Error GoTo cmdItemAdd_Click_Err
Dim dbs As Database, rst As RecordSet
Set dbs = CuttentDB
Set rst = dbs.OpenRecordset("Item", dbOpenDynaset)
With rst
.AddNew
![Item_Serial] = txtHardSerial.value
:
:
:
.Update
End With
rst.Close
cmdItemAdd_Click_Exit:
Exit Sub
cmdItemAdd_Click_Err
MsgBox Err.Description
Resume cmdItemAdd_Exit
End Sub
Dim dbs AS Database, rst AS RecordSet is causing an error because the data type Database isn't recognized. Isn't this built in?