拆分多用户MS Access Db。表覆盖问题

时间:2017-03-07 15:12:25

标签: database vba access

我有一个拆分的多用户Db,后端是加密的,不允许悲观锁定。后端表中的任务每天预加载,指定的字段自动填充为未分配。当员工点击开始任务或提交以转到下一个任务时,dlookup会识别下一个"未分配"任务通过dlookup并将字段更新为其名称。

我遇到的问题是表似乎没有足够快地更新,所以我遇到了几个人的前端(使用accde)没有认识到表已被更新并覆盖了相同的记录。我已经将自动刷新更新为从60开始的两秒,但我没有得到预期的结果。

有没有办法可以刷新每个命令按钮上的实际链接表单击vba,以便实时查看要移动到的正确记录?

以下是我的"开始"的代码。按钮。 "提交/下一个任务"按钮使用相同类型的编码来查找下一个任务。

Private Sub butagingicoms202_begin_Click()
Dim strsql As String
Dim AuditCheck As String
Dim NYPhone As String
Dim CAPhone As String
Dim LastTask As String
DoCmd.SetWarnings False
  If IsNull(DLookup("[Sys]", "Aging_ICOMSWorkable", "assigned = 'unassigned'")) Then
 LastTask = True
 Else
 LastTask = False
 End If
 If LastTask = True Then
 MsgBox "All tasks have been assigned. Please move on to your next assigned project"
 DoCmd.SetWarnings True
 DoCmd.Close acForm, "Aging_ICOMS202DailyWorkable_frm"
 Else
Call RandomTime
butagingicoms202_submit.Visible = True
Me.butagingicoms202_submit.SetFocus
butagingicoms202_queue.Visible = True
butagingicoms202_begin.Visible = False
txtagingicoms202_sysacct = DLookup("[sysacct]", "Aging_ICOMSWorkable", "[SYS]=202 AND [Assigned] = 'unassigned' AND [SecondaryTask]<>'50 Day'  AND [SecondaryTask]<>'Spec Review' AND [SecondaryTask]<>'Low Bal Rpt'")
DoCmd.RunSQL "UPDATE Aging_ICOMSWorkable SET assigned = '" & Me.txtagingicoms202_assigned & "' WHERE sysacct = [txtagingicoms202_sysacct]"
txtagingicoms202_acct = DLookup("[AccountNumber]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'")
txtagingicoms202_sys = DLookup("[Sys]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'")
txtagingicoms202_name = DLookup("[Name]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'")
'txtagingicoms202_fn = DLookup("[FirstName]", "Aging_ICOMSWorkable", "[Assigned] = 'unassigned'")
'txtagingicoms202_ln = DLookup("[LastName]", "Aging_ICOMSWorkable", "[Assigned] = 'unassigned'")
txtagingicoms202_task = DLookup("[Task]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'")
txtagingicoms202_tt = DLookup("[Task]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'")
txtagingicoms202_assignment = DLookup("[SecondaryTask]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'")
'NYPhone = DLookup("[NYSTATE]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & me.txtagingicoms202_assigned &"'")
'CAPhone = DLookup("[PW CAL PHONE?]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & me.txtagingicoms202_assigned &"'")
txtagingicoms202_TotalAR = "$" & Format(DLookup("[Total A/R Balance]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'"), "0.00")
txtagingicoms202_PDbal = "$" & Format(DLookup("[Delinquent Balance]", "Aging_ICOMSWorkable", "sysacct = '" & Me.txtagingicoms202_sysacct & "' AND assigned = '" & Me.txtagingicoms202_assigned & "'"), "0.00")

'txtagingicoms202_secassign = DLookup("[Secondary Task]", "Aging_ICOMSWorkable", "[Assigned] = 'unassigned'")
txtagingicoms202_starttime = Now()
strsql = "UPDATE Aging_ICOMSWorkable SET Start_Time = '" & Me.txtagingicoms202_starttime & "' WHERE sysacct = [txtagingicoms202_sysacct]"
DoCmd.RunSQL strsql
Me.comagingicoms202_res.RowSource = "SELECT [ResolutionCodes] FROM [Resolutions]" & "WHERE [tasktype] = '" & Me.txtagingicoms202_tt & "'"
Me.comagingicoms202_res.Requery
DoCmd.SetWarnings True
End If
End Sub

0 个答案:

没有答案