|
-
Jun 26th, 2003, 05:27 AM
#1
Thread Starter
Fanatic Member
Update current Record
Hi
I have a label which contains an ID now what I want to do is
update the current record if the label contains a value and if not
insert a row....
The code related to the condition is below
VB Code:
If (lblScaleEventID > 0) Or (ObjRSprodidvalues.EOF) Then
ObjRSprodidvalues.MovePrevious
ObjRSprodidvalues.Update
ElseIf (ObjRSprodidvalues.BOF) Then
Load frmvoidopid
frmvoidopid.Show vbModal
Else
ObjRSprodidvalues.MoveLast
End If
lblScaleEventID = ObjRSprodidvalues.Fields(0).Value
I receive an error ' EOF or BOF is true' or record is deleted...
Thanks for your help
** HOLLY ** 
-
Jun 26th, 2003, 09:46 AM
#2
Hyperactive Member
Re: Update current Record
Originally posted by holly
Hi
I have a label which contains an ID now what I want to do is
update the current record if the label contains a value and if not
insert a row....
The code related to the condition is below
VB Code:
If (lblScaleEventID > 0) Or (ObjRSprodidvalues.EOF) Then
ObjRSprodidvalues.MovePrevious
ObjRSprodidvalues.Update
ElseIf (ObjRSprodidvalues.BOF) Then
Load frmvoidopid
frmvoidopid.Show vbModal
Else
ObjRSprodidvalues.MoveLast
End If
lblScaleEventID = ObjRSprodidvalues.Fields(0).Value
I receive an error ' EOF or BOF is true' or record is deleted...
Thanks for your help
Which part of the code containing EOF or BOF does the error pop up? In other words which line does the error show...
-
Jun 26th, 2003, 09:52 AM
#3
Frenzied Member
Re: Update current Record
Originally posted by holly
ObjRSprodidvalues.MovePrevious
ObjRSprodidvalues.Update
These two lines of your code cousing this problem and doesn't make any sence.
Why would you move to the previous record and update it in same time. There is no changes for record at this time. Why would you update it?
-
Jun 27th, 2003, 01:14 AM
#4
Thread Starter
Fanatic Member
Re: Re: Update current Record
Which part of the code containing EOF or BOF does the error pop up? In other words which line does the error show...
Apps tech the error line is
VB Code:
If (lblScaleEventID > 0) Or (ObjRSprodidvalues.EOF) Then
Originally posted by andreys
These two lines of your code cousing this problem and doesn't make any sence.
Why would you move to the previous record and update it in same time. There is no changes for record at this time. Why would you update it?
There is a logical reason:
The user enter a valid number but there is always a chance that
they may enter the wrong number...This procedure uses a SP
which validates this number and inserts the values into another
table....the ID number is then placed into a label....
so for example
user enter 123456 instead of 123345 now because these two
numbers are valid they will both be acknowledges and inserted
into the table but the proble is 123456 should never of been
entered.
Hope thats clear
** HOLLY ** 
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
|