|
-
September 20th, 2001, 10:05 AM
#1
.Absolute Position
I have a code errors out telling me I have an invalid key. The code it errors on is as follows:
Do While Not rs.EOF
.Add rs.AbsolutePosition + 1, rs!Site_Number, rs!Site_Number
rs.MoveNext
Loop
(it errors at the .ADD rs line)
I can't find any help on the invalid key error. Anyone have any suggestions?
Thanks
Pat
-
September 20th, 2001, 10:38 AM
#2
Re: .Absolute Position
.Add rs.AbsolutePosition + 1, rs!Site_Number, rs!Site_Number
First of all I never heard about .Add statement (maybe it is my problem). As far as I know only AddNew exists. If youare trying to add a new record you have to consider 2 things
1.AbsolutePosition not always gives you the accurate record number
2. AddNew always add a new record at the end of the recordset
If that is what you are trying to accomplish the syntax is
with rs
.AddNew
!Field1 = ...
!Field2 = ...
.Update
end with
Iouri Boutchkine
[email protected]
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
|