Hello,
I have a VB6 project that I am trying to edit. There is a subroutine in this project called Add that I have copied and pasted into the same project as a new subroutine with the name of Add2.
Here is the code for both subs.
****code for first sub****
Private Sub Add()
Set rsTableForUPSImport = dbTableForUPSImport.OpenRecordset("SELECT * FROM TableForUPSImport")
With rsTableForUPSImport
'Set it to Add mode
.AddNew
'Enter the field values
.Fields("void").Value = rsUPSWorld!void
.Fields("serv_type").Value = rsUPSWorld!serv_type
.Fields("billing_op").Value = rsUPSWorld!billing_op
.Fields("return_op").Value = rsUPSWorld!return_op
.Fields("sn1memo").Value = rsUPSWorld!sn1memo
.Fields("sn2fax").Value = rsUPSWorld!sn2fax
.Fields("sn2intlf").Value = rsUPSWorld!sn2intlf
.Fields("sn2memo").Value = rsUPSWorld!sn2memo
.Fields("verbconfop").Value = rsUPSWorld!verbconfop
.Fields("verbcont").Value = rsUPSWorld!verbcont
.Fields("verbphone").Value = rsUPSWorld!verbphone
.Fields("length").Value = rsUPSWorld!length
.Fields("width").Value = rsUPSWorld!Width
.Fields("height").Value = rsUPSWorld!Height
.Fields("merchdesc").Value = rsUPSWorld!merchdesc
.Fields("date").Value = Format$(Date, "mm/dd/yyyy")
'Update it
.Update
'Close it
.Close
End With
End Sub
****end of code for first sub****
****code for second sub****
Private Sub Add2()
Set rsUSPS = dbUSPS.OpenRecordset("Select * FROM USPS")
With rsUSPS
'Set it to Add mode
.AddNew
'Enter the field values
.Fields("void").Value = rsUSPS!void
.Fields("serv_type").Value = rsUSPS!serv_type
.Fields("billing_op").Value = rsUSPS!billing_op
.Fields("return_op").Value = rsUSPS!return_op
.Fields("sn1memo").Value = rsUSPS!sn1memo
.Fields("sn2fax").Value = rsUSPS!sn2fax
.Fields("sn2intlf").Value = rsUSPS!sn2intlf
.Fields("sn2memo").Value = rsUSPSd!sn2memo
.Fields("verbconfop").Value = rsUSPS!verbconfop
.Fields("verbcont").Value = rsUSPS!verbcont
.Fields("verbphone").Value = rsUSPS!verbphone
.Fields("length").Value = rsUSPS!length
.Fields("width").Value = rsUSPS!Width
.Fields("height").Value = rsUSPS!Height
.Fields("merchdesc").Value = rsUSPS!merchdesc
.Fields("date").Value = Format$(Date, "mm/dd/yyyy")
'Update it
.Update
'Close it
.Close
End With
End Sub
****end of code for second sub****
Both subs add records from an Access 97 table to a recordset that is declared in the VB program. When I try to compile the project I receive an error and the .AddNew code in the Add2 subroutine highlighted.
Here is the exact error.
"Compile error:
Method or data member not found."
Is there something obvious I am missing? I could really use some help.
Thank you very much,
malaize2
I have a VB6 project that I am trying to edit. There is a subroutine in this project called Add that I have copied and pasted into the same project as a new subroutine with the name of Add2.
Here is the code for both subs.
****code for first sub****
Private Sub Add()
Set rsTableForUPSImport = dbTableForUPSImport.OpenRecordset("SELECT * FROM TableForUPSImport")
With rsTableForUPSImport
'Set it to Add mode
.AddNew
'Enter the field values
.Fields("void").Value = rsUPSWorld!void
.Fields("serv_type").Value = rsUPSWorld!serv_type
.Fields("billing_op").Value = rsUPSWorld!billing_op
.Fields("return_op").Value = rsUPSWorld!return_op
.Fields("sn1memo").Value = rsUPSWorld!sn1memo
.Fields("sn2fax").Value = rsUPSWorld!sn2fax
.Fields("sn2intlf").Value = rsUPSWorld!sn2intlf
.Fields("sn2memo").Value = rsUPSWorld!sn2memo
.Fields("verbconfop").Value = rsUPSWorld!verbconfop
.Fields("verbcont").Value = rsUPSWorld!verbcont
.Fields("verbphone").Value = rsUPSWorld!verbphone
.Fields("length").Value = rsUPSWorld!length
.Fields("width").Value = rsUPSWorld!Width
.Fields("height").Value = rsUPSWorld!Height
.Fields("merchdesc").Value = rsUPSWorld!merchdesc
.Fields("date").Value = Format$(Date, "mm/dd/yyyy")
'Update it
.Update
'Close it
.Close
End With
End Sub
****end of code for first sub****
****code for second sub****
Private Sub Add2()
Set rsUSPS = dbUSPS.OpenRecordset("Select * FROM USPS")
With rsUSPS
'Set it to Add mode
.AddNew
'Enter the field values
.Fields("void").Value = rsUSPS!void
.Fields("serv_type").Value = rsUSPS!serv_type
.Fields("billing_op").Value = rsUSPS!billing_op
.Fields("return_op").Value = rsUSPS!return_op
.Fields("sn1memo").Value = rsUSPS!sn1memo
.Fields("sn2fax").Value = rsUSPS!sn2fax
.Fields("sn2intlf").Value = rsUSPS!sn2intlf
.Fields("sn2memo").Value = rsUSPSd!sn2memo
.Fields("verbconfop").Value = rsUSPS!verbconfop
.Fields("verbcont").Value = rsUSPS!verbcont
.Fields("verbphone").Value = rsUSPS!verbphone
.Fields("length").Value = rsUSPS!length
.Fields("width").Value = rsUSPS!Width
.Fields("height").Value = rsUSPS!Height
.Fields("merchdesc").Value = rsUSPS!merchdesc
.Fields("date").Value = Format$(Date, "mm/dd/yyyy")
'Update it
.Update
'Close it
.Close
End With
End Sub
****end of code for second sub****
Both subs add records from an Access 97 table to a recordset that is declared in the VB program. When I try to compile the project I receive an error and the .AddNew code in the Add2 subroutine highlighted.
Here is the exact error.
"Compile error:
Method or data member not found."
Is there something obvious I am missing? I could really use some help.
Thank you very much,
malaize2