trying to use ADO to add records

Joined
Jul 19, 2005
Messages
22
Reaction score
0
Hi all. I am using VB to try to add records to a table. The code is as follows but with a lot more than 6 fields. I am talking around 25 or so. If I try to add all the records in the form at once it saids "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data." Is there a way to get around this? I tried making different record sets but then the record is split into different rows. Please help!!



Dim rst As New ADODB.Recordset
rst.Open "tblTreatyBasicInfo", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With rst
.AddNew
![Company] = Me.Company.Value
![Company_Code] = Me.Company_Code.Value
![PlansCovered] = Me.PlansCovered.Value
![RecaptureYears] = Me.RecaptureYears.Value
![Age] = Me.Age.Value
![MktgOff] = Me.MktgOff.Value
.Update
End With
rst.Close
Set rst = Nothing
 
Back
Top