Re: Need expert coding help with a debugging issue.
- From: Nicholas Scarpinato <NicholasScarpinato@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 12:54:06 -0800
Yay! I think I finally fixed it!
I built a check code to verify which user had accessed the temp table most
recently. If the user is "None", then nobody's using the table, and the
database updates that table with the current username. Then it waits five
seconds before continuing, to make sure that the table updated properly
(trying to account for network lag, our LAN is ridiculously slow for as big
of a company as we are). If another user hits the temp table and changes the
username stored in it before the table updates, the first user will have to
wait for the second user to finish. Likewise, if the second user hits the
temp table after the update finishes, they will have to wait for the first
one to finish.
Private Sub Talk_Time_AfterUpdate()
DoCmd.SetWarnings False
DoCmd.OpenForm "UsernameForm", , , , , acHidden
RunProcess:
If DLookup("Username", "User Actions Table", "Username = 'None'") = "None"
Then
Forms![UsernameForm].[Username] = UsernameTag
DoCmd.OpenQuery "Update User Actions Table"
DoCmd.OpenForm "Delay Form", , , , , acDialog
If DLookup("Username", "User Actions Table", "Username = '" &
UsernameTag _
& "'") = UsernameTag Then
Me![Scan Time] = Now() & " - " & UsernameTag
DoCmd.OpenQuery "Add New Record"
Call BinLocationsNew(Me![Vendor Name])
Else
GoTo FiveSecDelay
End If
....
(skipped a bunch of form formatting stuff... I had to unbind the form
to make this work, otherwise it kept saying it couldn't save the record)
....
Else
FiveSecDelay:
DoCmd.OpenForm "Delay Form", , , , , acDialog
GoTo RunProcess
End If
DoCmd.OpenQuery "Reset User Action Table"
DoCmd.Close acForm, "UsernameForm"
DoCmd.SetWarnings True
End Sub
I know I did the GoTo sin again, but I couldn't figure out another way to
make it loop back to the beginning with subs. In a way, it IS an error
handler... it's saying that the table is not available, try again later.
.
- Follow-Ups:
- Re: Need expert coding help with a debugging issue.
- From: BruceM
- Re: Need expert coding help with a debugging issue.
- References:
- Need expert coding help with a debugging issue.
- From: Nicholas Scarpinato
- Re: Need expert coding help with a debugging issue.
- From: BruceM
- Re: Need expert coding help with a debugging issue.
- From: Nicholas Scarpinato
- Re: Need expert coding help with a debugging issue.
- From: BruceM
- Re: Need expert coding help with a debugging issue.
- From: Nicholas Scarpinato
- Re: Need expert coding help with a debugging issue.
- From: BruceM
- Re: Need expert coding help with a debugging issue.
- From: Nicholas Scarpinato
- Re: Need expert coding help with a debugging issue.
- From: BruceM
- Re: Need expert coding help with a debugging issue.
- From: Nicholas Scarpinato
- Need expert coding help with a debugging issue.
- Prev by Date: RE: Export to Excel: 2nd, 3rd, etc excel files not opening up
- Next by Date: Position of Minimised Form
- Previous by thread: Re: Need expert coding help with a debugging issue.
- Next by thread: Re: Need expert coding help with a debugging issue.
- Index(es):
Relevant Pages
|