Can Any one shed some light on this problem i have.
I have a database with a table called "Main". I am trying to copy three filtered bit of information from a form to create a new record but i keep getting this error:
Run-Time Error '13'
Type Mismatch
My coding is:
Dim txtProj As String, txtArea As String, txtSect As String
Dim dbs As Database, rst As Recordset
txtProj = Me.Project
txtArea = me.Area
txtSect = me.Section1
Set dbs = currentdb
Set rst = dbs.Openrecordset("Main"
rst.AddNew
rst.Fields("Project" = txtProj
rst.Fields("Area" = txtArea
rst.Fields("Section" = txtSect
rst.Update
rst.Close
Set dbs = Nothing
The error comes from Set rst= dbs.Recordset("Main"
(Me.Project is a text field)
(Me.Area is a number field)
(Me.Section1 is a number field)
Can anyone see any errors in my coding or suggest any solutions?