matethreat
Technical User
Hello,
I have a form with 3 unbound text boxes. I want to be able to append the data to a table when I exit the form. I get the following error each time.
User-Defined Type Not Defined
(This error is on the first line of my code)
Dim cnn As DAO.Database
Dim rs As DAO.Recordset
Set cnn = CurrentDb()
Set rs = cnn.OpenRecordSet("Material")
With rs
.AddNew
![Description] = Me.Description2
![ItemNumber] = Me.ItemNumber
![Value] = Me.Value
.Append
End With
rs.Close
cnn.Close
This isn't working????
I am not sure what I am doing wrong
I have a form with 3 unbound text boxes. I want to be able to append the data to a table when I exit the form. I get the following error each time.
User-Defined Type Not Defined
(This error is on the first line of my code)
Dim cnn As DAO.Database
Dim rs As DAO.Recordset
Set cnn = CurrentDb()
Set rs = cnn.OpenRecordSet("Material")
With rs
.AddNew
![Description] = Me.Description2
![ItemNumber] = Me.ItemNumber
![Value] = Me.Value
.Append
End With
rs.Close
cnn.Close
This isn't working????
I am not sure what I am doing wrong