RichO
Registered Yoozer
- Local time
- Yesterday, 20:01
- Joined
- Jan 14, 2004
- Messages
- 1,036
Here's a strange one.....
We have only 4 computers in our office. Our DB backend is SQL server and due to constant corruption of the database from multiple users, each user/computer runs its own separate copy of the mdb file.
I have set up a small form in a separate database to allow me to quickly compact the DB and copy it to the 4 locations on the network instead of doing it manually. This process works fine...BUT....I have a text box on the form set up to display the copy progress and the contents of the text box do not properly display during the file copying. Even though the code to change the value of the textbox comes before the file copy command, the textbox will not display the until after the copying is finished. However, when I step debug the process it displays the information correctly before the file copy command executes.
Here is a sample of my code...
Can anyone explain why this is happening and possibly a way around it?
Thanks
We have only 4 computers in our office. Our DB backend is SQL server and due to constant corruption of the database from multiple users, each user/computer runs its own separate copy of the mdb file.
I have set up a small form in a separate database to allow me to quickly compact the DB and copy it to the 4 locations on the network instead of doing it manually. This process works fine...BUT....I have a text box on the form set up to display the copy progress and the contents of the text box do not properly display during the file copying. Even though the code to change the value of the textbox comes before the file copy command, the textbox will not display the until after the copying is finished. However, when I step debug the process it displays the information correctly before the file copy command executes.
Here is a sample of my code...
Code:
Dim strPath1 As String
Dim strpath2 As String
strPath1 = "C:\FortuneSystem\Temp.mdb"
strpath2 = "\\Scott\Fortune\"
If Dir("C:\FortuneSystem\Fortune_System.ldb") <> vbNullString Then
MsgBox "Cannot proceed! Fortune database is open.", vbCritical
Exit Sub
End If
[B]txtProgress = "Compacting Database"[/B]
[COLOR="YellowGreen"]'compact master DB to a temporary DB file[/COLOR]
DBEngine.CompactDatabase "C:\FortuneSystem\Fortune_System.mdb", strPath1
[b]txtProgress = ""[/b]
If chkTed Then
If Dir(strpath2 & "Ted.ldb") <> vbNullString Then
MsgBox "Ted cannot be copied. Program is running.", vbCritical
Else
Screen.MousePointer = 11
[b]txtProgress = "Ted Copying"[/b]
Kill strpath2 & "Ted.mdb"
FileCopy strPath1, strpath2 & "Ted.mdb"
[b]txtProgress = ""[/b]
Screen.MousePointer = 0
End If
End If
....etc...
Can anyone explain why this is happening and possibly a way around it?
Thanks