Re: Need expert coding help with a debugging issue.



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.
.



Relevant Pages

  • Re: Need expert coding help with a debugging issue.
    ... For the second user, the comparison shows the numbers are different, and a new number is generated. ... I built a check code to verify which user had accessed the temp table most ... database updates that table with the current username. ... GoTo FiveSecDelay ...
    (microsoft.public.access.formscoding)
  • invalid tests on unsigned
    ... return ret; ... goto done; ... goto err; ... else if (size < temp) ...
    (Linux-Kernel)
  • Re: formatting cells to show time format
    ... Dim InputRange As Range ... Dim Temp As Variant ... Is Nothing Then GoTo Bye ... > out the formatting of the cells so they show hours, ...
    (microsoft.public.excel.misc)
  • Re: Cant delete temp files
    ... went through the process of stopping each start-up program and was able to ... So you are one of those who has this %temp% growing on bootup/switch-on - ... So I cannot get a build up test with Disk Cleaner. ... Then two days after the updates, I went in to clean it and they had all gone ...
    (microsoft.public.windowsxp.basics)
  • Re: Cursor problem for teired pricing
    ... @VolumeThreshold), that was incorrect. ... against inserts and updates while processing ... (I may make this a temp table depending on server memory) ... copy current_month_loc_nine to Loc9 allowing it to assign Loc9ID to ...
    (microsoft.public.data.ado)