T
TA
Hi ,
I have a piece of code here I don't know where is wrong
but it can not exit Do while loop, please help, Thank you
If Rs_Cum.RecordCount > 0 Then
MsgBox "Do you want to run the Error Checking
Report ?", vbOKCancel
If vbOKCancel = 2 Then
DoCmd.Close
DoCmd.OpenForm "FrmMainMenu"
ElseIf vbOKCancel = 1 Then
Rs_Cum.MoveFirst
Do Until Rs_Cum.EOF
tempID = Trim(Rs_Cum.Fields("ident").Value)
Rs_Cum.MoveNext
If (Rs_Cum.Fields("ident").Value) = tempID Then
Rs3.AddNew
Rs3!Ident = tempID
Rs3!batch = Rs_Cum.Fields("batch").Value
Rs3!seqnum = Rs_Cum.Fields("seqnum").Value
Rs3!Code = "100"
Rs3.Update
Rs_Cum.MovePrevious
Else
Rs_Cum.MovePrevious
End If
Rs_Cum.MoveNext
'MsgBox "end of if and update" OK here
Loop
'MsgBox "Out of loop" NOT OK here
End If ' of vbOKCancel
End If ' of Rs_cum >0
Docmd.close
Docmd.Openform "FrmMainMenu"
It can not close this form and can not open a new form
call FrmMainMenu. Please help Thank you for any suggestion.
TA
I have a piece of code here I don't know where is wrong
but it can not exit Do while loop, please help, Thank you
If Rs_Cum.RecordCount > 0 Then
MsgBox "Do you want to run the Error Checking
Report ?", vbOKCancel
If vbOKCancel = 2 Then
DoCmd.Close
DoCmd.OpenForm "FrmMainMenu"
ElseIf vbOKCancel = 1 Then
Rs_Cum.MoveFirst
Do Until Rs_Cum.EOF
tempID = Trim(Rs_Cum.Fields("ident").Value)
Rs_Cum.MoveNext
If (Rs_Cum.Fields("ident").Value) = tempID Then
Rs3.AddNew
Rs3!Ident = tempID
Rs3!batch = Rs_Cum.Fields("batch").Value
Rs3!seqnum = Rs_Cum.Fields("seqnum").Value
Rs3!Code = "100"
Rs3.Update
Rs_Cum.MovePrevious
Else
Rs_Cum.MovePrevious
End If
Rs_Cum.MoveNext
'MsgBox "end of if and update" OK here
Loop
'MsgBox "Out of loop" NOT OK here
End If ' of vbOKCancel
End If ' of Rs_cum >0
Docmd.close
Docmd.Openform "FrmMainMenu"
It can not close this form and can not open a new form
call FrmMainMenu. Please help Thank you for any suggestion.
TA