aksesvibiey
New member
- Local time
- Today, 00:17
- Joined
- Feb 26, 2007
- Messages
- 7
hello..
I have this problem that when I update the value in one of my tables, MS Access hangs up. I don't know why. I dont know if it's because of the updating or because of something else.. Any help would be greatly appreciated.. Thanks in advance!
here the code that's executed when the approve button is clicked..
Private Sub Command43_Click()
Answer = MsgBox("Are you sure you want to approve this timesheet? Note that only projects approved by respective project managers will be approved.", vbYesNo)
'if cancelled
If Answer = vbNo Then
Else
Dim rs As Object
Dim x As Integer 'will be used as a flag for do while loop
x = 1 'initialize flag
Set rs = Me.Recordset.Clone
rs.FindFirst "[weekending] = #" & Format(Me![weekending], "mm\/dd\/yyyy") & "#"
'finding the first record wich matches the weekending doesn't give the right record
'right away. it may give a record with the right weekending but different eno. that is
'not supposed to happen. so once a weekending match is found, check if the eno also
'matches. this do..while loop will do the trick =)
Do While x < 18
If rs!eno = Forms!TimesheetDetailsFrm!eno And rs!statusPM = "approved" Then
rs.Edit
rs!status = "approved"
rs.Update
x = x + 1
End If
rs.FindNext "[weekending] = #" & Format(Me![weekending], "mm\/dd\/yyyy") & "#"
Loop
'close this form and refresh the 'timesheets for approval' form
Answer = MsgBox("You have successfully approved the timesheet. Close this window to continue viewing other submitted timesheets.")
Forms!SupervisorFrm.Requery
End If
End Sub
Thanks again..
ps. How do I mark a post as 'resolved'? Coz I have a previous post which has already been solved.. Thanks to all of you guys.
I have this problem that when I update the value in one of my tables, MS Access hangs up. I don't know why. I dont know if it's because of the updating or because of something else.. Any help would be greatly appreciated.. Thanks in advance!

here the code that's executed when the approve button is clicked..
Private Sub Command43_Click()
Answer = MsgBox("Are you sure you want to approve this timesheet? Note that only projects approved by respective project managers will be approved.", vbYesNo)
'if cancelled
If Answer = vbNo Then
Else
Dim rs As Object
Dim x As Integer 'will be used as a flag for do while loop
x = 1 'initialize flag
Set rs = Me.Recordset.Clone
rs.FindFirst "[weekending] = #" & Format(Me![weekending], "mm\/dd\/yyyy") & "#"
'finding the first record wich matches the weekending doesn't give the right record
'right away. it may give a record with the right weekending but different eno. that is
'not supposed to happen. so once a weekending match is found, check if the eno also
'matches. this do..while loop will do the trick =)
Do While x < 18
If rs!eno = Forms!TimesheetDetailsFrm!eno And rs!statusPM = "approved" Then
rs.Edit
rs!status = "approved"
rs.Update
x = x + 1
End If
rs.FindNext "[weekending] = #" & Format(Me![weekending], "mm\/dd\/yyyy") & "#"
Loop
'close this form and refresh the 'timesheets for approval' form
Answer = MsgBox("You have successfully approved the timesheet. Close this window to continue viewing other submitted timesheets.")
Forms!SupervisorFrm.Requery
End If
End Sub
Thanks again..
ps. How do I mark a post as 'resolved'? Coz I have a previous post which has already been solved.. Thanks to all of you guys.
