|
-
Oct 11th, 2001, 05:38 AM
#1
Thread Starter
Junior Member
Trouble using AddNew
Hi Again,
I am attempting to create a record on click of my add button.
I am not using DAO.
I am not really sure how to go about assigning values to the DB fields but this is what I am doing....
Set myDB1 = OpenDatabase("c:\Defects\Defects97.mdb")
Set rst1 = myDB1.OpenRecordset("Select * From MajorComponents")
rst1.AddNew Array("MajorComponent", "AltComponent", "TailNumber", "SnapShotDate", "Descriptor", "ScreenShotLocation"), Array("combo1.Text", "combo2.Text", "combo3.text", "text1.text", "File1.Path & '\' & File1.FileName", "text2.text")
The error I get is ... Wrong number of arguments or invalid property assignment.
I'd appreciate some help on this.
Cheers
-
Oct 11th, 2001, 05:46 AM
#2
-= B u g S l a y e r =-
hmm never seen it done this way... what i would do is something like this:
VB Code:
Set rst1 = myDB1.OpenRecordset("Select * From MajorComponents")
rst1.AddNew
rst1("MajorComponent") = Combo1.Text
rst1("AltComponent") = Combo2.Text
rst1("TailNumber") = Combo3.Text
rst1("SnapShotDate") = Text1.Text
rst1.Update 'ommit if using ADO
-
Oct 11th, 2001, 02:31 PM
#3
Hyperactive Member
the way u open your database is actually
telling me that u are using DAO
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|