D
disneygoof via AccessMonster.com
Geetings to all,
I have a bizzar problem. I have created a "time tracker" that 12 detailers
use. What this form does, I thought, is very simple.
1. they choose an option (design, detialing, checking, etc)
2. they click a button called (start)
3. I capture date and time
4. when they are done, they click stop
5. i transfer a row of data from a working table to a history table
6. I delete the row in the working table.
here's the issue...
sometimes the delete query does not fire.
Private Sub btnStopTrack_Click()
On Error GoTo Err_btnStopTrack_Click
Me.StopDate = Date
Me.StopTIme = Time
Me.STST = "DONE" 'trigger
Me.Requery
Me.Refresh
Me.btnStartTrack.Visible = True
Me.btnStartTrack.SetFocus
Me.btnStopTrack.Visible = False
Me.Requery
DoCmd.OpenQuery "qryDetailingTimeTransferToHoursTable" 'append to
history
DoCmd.OpenQuery "qryDetailingTimeDeleteFromTimeTable" 'delete from
working
If CurrentProject.AllForms("frmBulletin").IsLoaded = True Then
Forms!frmBulletin.Form.UserTracking = ""
End If
DoCmd.Close
Exit_btnStopTrack_Click:
Exit Sub
Err_btnStopTrack_Click:
MsgBox err.Description
Resume Exit_btnStopTrack_Click
End Sub
The Delete query looks for the users login name in the table AND the work
"DONE", if exists, delete that Row. Sometime it works, sometimes it does not.
It seems to be an issue more so at lunch when everyone might be "clocking"
out. I am sure it has something to do with the fact that we have muilt-users
in the same table. However, it does happen off and on through the day. I
have tried a number of options (using a macro, checking for the row in the
table when I load the form, checking for the row in the table from a previous
form) but nothing seems to completely solve the issue. I have been fighting
this for over a month. Last Friday, no issues, yesterday I have 6 issues.
Today so far 1 issue.
Problem.
If the row does not delete, then the user can not clock into another project..
..they are stuck in limbo and I have to manaul delete the row. The Append
query works perfect every time.
About a week ago I added the following code...basically I look to see if the
row has the current user (GetUserName) and the work "DONE". And you can see
I then run the detete query if they exist. But this does not always work
either.
Private Sub Form_Open(Cancel As Integer)
Dim leftOver As Integer
leftOver = Nz(DLookup("[ProjectID]", "tblDetailingTimeTracker", "
[Username] ='" & GetUserName()& "' and Not IsNull([STST])"), 0)
If leftOver <> 0 Then
DoCmd.OpenQuery "qryDetailingTimeDeleteFromTimeTable"
Me.Requery
End If
End Sub
HELP!!!!!!!!!!
Thanks David
I have a bizzar problem. I have created a "time tracker" that 12 detailers
use. What this form does, I thought, is very simple.
1. they choose an option (design, detialing, checking, etc)
2. they click a button called (start)
3. I capture date and time
4. when they are done, they click stop
5. i transfer a row of data from a working table to a history table
6. I delete the row in the working table.
here's the issue...
sometimes the delete query does not fire.
Private Sub btnStopTrack_Click()
On Error GoTo Err_btnStopTrack_Click
Me.StopDate = Date
Me.StopTIme = Time
Me.STST = "DONE" 'trigger
Me.Requery
Me.Refresh
Me.btnStartTrack.Visible = True
Me.btnStartTrack.SetFocus
Me.btnStopTrack.Visible = False
Me.Requery
DoCmd.OpenQuery "qryDetailingTimeTransferToHoursTable" 'append to
history
DoCmd.OpenQuery "qryDetailingTimeDeleteFromTimeTable" 'delete from
working
If CurrentProject.AllForms("frmBulletin").IsLoaded = True Then
Forms!frmBulletin.Form.UserTracking = ""
End If
DoCmd.Close
Exit_btnStopTrack_Click:
Exit Sub
Err_btnStopTrack_Click:
MsgBox err.Description
Resume Exit_btnStopTrack_Click
End Sub
The Delete query looks for the users login name in the table AND the work
"DONE", if exists, delete that Row. Sometime it works, sometimes it does not.
It seems to be an issue more so at lunch when everyone might be "clocking"
out. I am sure it has something to do with the fact that we have muilt-users
in the same table. However, it does happen off and on through the day. I
have tried a number of options (using a macro, checking for the row in the
table when I load the form, checking for the row in the table from a previous
form) but nothing seems to completely solve the issue. I have been fighting
this for over a month. Last Friday, no issues, yesterday I have 6 issues.
Today so far 1 issue.
Problem.
If the row does not delete, then the user can not clock into another project..
..they are stuck in limbo and I have to manaul delete the row. The Append
query works perfect every time.
About a week ago I added the following code...basically I look to see if the
row has the current user (GetUserName) and the work "DONE". And you can see
I then run the detete query if they exist. But this does not always work
either.
Private Sub Form_Open(Cancel As Integer)
Dim leftOver As Integer
leftOver = Nz(DLookup("[ProjectID]", "tblDetailingTimeTracker", "
[Username] ='" & GetUserName()& "' and Not IsNull([STST])"), 0)
If leftOver <> 0 Then
DoCmd.OpenQuery "qryDetailingTimeDeleteFromTimeTable"
Me.Requery
End If
End Sub
HELP!!!!!!!!!!
Thanks David