By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,520 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

Code works on design database, but not in work database (in the network)

P: n/a
Hi,this has been bothering me for a while now. I have 2 MS Access 2000
databases, the real one that everybody uses (in the NT network) and the
one I use to design new stuff. After I test the new forms on mine, I
import them to the real database so everybody can use it.

However, some of the code that works perfectly in my design database
fails when I import the form to the network database. Sometimes the
code is as simple as "docmd.close" or "me.close" when trying to close a
form. I have to use "DoCmd.Close acForm, "formname", acSaveNo so it
could work properly. I have checked the tool reference libraries on
both databases and they have the same stuff and in the same order.

Other times, if I use periods instead of ! the code doesn't work in the
network Database, yet it works on my design one. i.e. "me.ProductID"
as opposed to "me!productID"

Does anybody has any ideas why the code I test for hours works
perfectly fine in my design database, but when I import the forms into
the network database it fails miserably?

Any help would be appreciated it.

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
The problem you are having is that multiple people are sharing the same
frontend interface. The solution to this problem is for each user to
have their own copy of the frontend. It is the backend containing the
data which is what you share across the network. You will find that if
you distribute the frontend individually you will have a lot less havoc.
I wrote a vbscript button for each user that checks a folder on the
network for updated versions of the frontend and updates each user
automatically/seamlessly whenever I have to perform upgrades on a
frontend. I was going to share the code, but it is a little bit
involved - too long for this post: well, I'll share a portion of it:

this is the part that is fun (the part that starts up Access). I left
out the not fun part - because it's long and not fun.

'''''''''''''''''''''''''''''here we check if there are updated
files on server which need to be updated to
workstation''''''''''''''''''''''''''''''''''''''' ''''''''''
cmd.CommandText = "Select Count(*) From tblServerFiles t1 Inner Join
tblWSfiles t2 " _
& "On t1.FileName = t2.FileName Where
t2.DateLastModified < t1.DateLastModified"
Set rs = cmd.Execute
v1 = rs(0)
If v1 > 0 Then
cmd.CommandText = "Select t1.FileName, t1.DateLastModified,
t1.FilePathName " _
& "From tblServerFiles t1 Inner Join
tblWSfiles t2 " _
& "On t1.FileName = t2.FileName Where
t2.DateLastModified < t1.DateLastModified"
Set rs = cmd.Execute
v = rs.GetRows(v1)
For i = 0 to Ubound(v,2) ''''''''''''''''''''this loop
updates files on workstation with latest/greatest from server
'msgbox v2(0, i) & " " & v2(1, i) & " " & v2(2, i)
If fso.FileExists(ScriptDirSum & v(0, i)) Then
fso.DeleteFile(ScriptDirSum & v(0, i))
fso.CopyFile v(2, i), ScriptDirSum & v(0, i)
cmd.CommandText = "Update tblWSfiles Set DateLastModified = #" &
v(1, i) & "# " _
& "Where FileName = '" & v(0, i) &
End If
End If
msgbox "No Files on Server! Contact Programmer!", 48, "Files Missing
on Server!"
End If
Set cmd = nothing
Shl.Run "MSACCESS.EXE " & ScriptDirSum & "CMCsummary2005b.mdb"


*** Sent via Developersdex ***
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.