G
Guest
Some time ago I posted a question about a database not working properly when
it was split, and Douglas J. Steele explained that it was because dbOpenTable
does not work in a split database, and he very kindly supplied revised code.
I had problems with getting the code working which I have only now had time
to sort out. The split database is far more stable across my network but
there are still two problems.
1. Some simple commands which are surprisingly slow are even slower in the
split database. For example this command button takes two minutes to run:
DoCmd.OpenReport "Enquiries by Enquiry Number", acViewPreview.
Command button:
DoCmd.OpenReport "All Enquiries by Type", acViewPreview
DoCmd.RunCommand acCmdZoom100
is so slow unsplit (20 minutes?) that I have not even tried it yet in the
split database.
2. There is still one live function, to cancel an invoice run, which does
not work as it uses dbOpenTable
Sub ReverseInvoicing()
Dim Invs As Recordset
Dim NewIN As Long
DoCmd.SetWarnings False
DoCmd.Hourglass True
Set Invs = CurrentDb().OpenRecordset("Invoices", dbOpenTable)
Invs.MoveFirst
Do While Invs.EOF = False
If Invs![Recent?] = True And Invs![One Off?] = False Then
DoCmd.RunSQL "UPDATE Enquiries SET [Invoice Number] = 0 WHERE "
& _
"([Invoice Number] = " & Invs![Invoice Number] & ");", False
End If
Invs.Move 1
Loop
DoCmd.RunSQL "UPDATE Invoices " & "SET [Processed?] = No, [Recent?] = No
" & _
"WHERE ([Recent?] = Yes AND [One Off?] = Yes);", False
DoCmd.RunSQL "DELETE * FROM [Invoices] WHERE [Recent?] = Yes;", False
Call RecalculateINSeed
DoCmd.SetWarnings True
DoCmd.Hourglass False
End Sub
Can anyone help on these points?
Many thanks
Dudley
it was split, and Douglas J. Steele explained that it was because dbOpenTable
does not work in a split database, and he very kindly supplied revised code.
I had problems with getting the code working which I have only now had time
to sort out. The split database is far more stable across my network but
there are still two problems.
1. Some simple commands which are surprisingly slow are even slower in the
split database. For example this command button takes two minutes to run:
DoCmd.OpenReport "Enquiries by Enquiry Number", acViewPreview.
Command button:
DoCmd.OpenReport "All Enquiries by Type", acViewPreview
DoCmd.RunCommand acCmdZoom100
is so slow unsplit (20 minutes?) that I have not even tried it yet in the
split database.
2. There is still one live function, to cancel an invoice run, which does
not work as it uses dbOpenTable
Sub ReverseInvoicing()
Dim Invs As Recordset
Dim NewIN As Long
DoCmd.SetWarnings False
DoCmd.Hourglass True
Set Invs = CurrentDb().OpenRecordset("Invoices", dbOpenTable)
Invs.MoveFirst
Do While Invs.EOF = False
If Invs![Recent?] = True And Invs![One Off?] = False Then
DoCmd.RunSQL "UPDATE Enquiries SET [Invoice Number] = 0 WHERE "
& _
"([Invoice Number] = " & Invs![Invoice Number] & ");", False
End If
Invs.Move 1
Loop
DoCmd.RunSQL "UPDATE Invoices " & "SET [Processed?] = No, [Recent?] = No
" & _
"WHERE ([Recent?] = Yes AND [One Off?] = Yes);", False
DoCmd.RunSQL "DELETE * FROM [Invoices] WHERE [Recent?] = Yes;", False
Call RecalculateINSeed
DoCmd.SetWarnings True
DoCmd.Hourglass False
End Sub
Can anyone help on these points?
Many thanks
Dudley