Different PC different result (1 Viewer)

Brian Martin

Registered User.
Local time
Today, 10:00
Joined
Jul 24, 2002
Messages
68
I have created a button on one of the forms in my database that works perfectly on my computer under my admin login. It also works perfectly on my computer under other users logins. But if I try on any other computer on the network even with my admin login it doesn't work. Each computer has the same version of Access 2002 and all have windows XP. This is the only time this has happened. Any ideas on what might be wrong. This is the code behind the button:

Private Sub Save_Click()
[Forms]![frmStore]![Trace].SetFocus
If [Forms]![frmStore]![Trace].Text = "T-***" Then
DoCmd.OpenQuery "qryReceived", acViewNormal, acEdit
DoCmd.OpenQuery "qryTraceQty", acViewNormal, acEdit
DoCmd.OpenQuery "qryDate2", acViewNormal, acEdit

Else
If Forms![frmStore]![Trace].Text = "N/A" Then
DoCmd.OpenQuery "qryReceived", acViewNormal, acEdit
DoCmd.OpenQuery "qryDate2", acViewNormal, acEdit
DoCmd.OpenQuery "qryUntrace", acViewNormal, acEdit
DoCmd.OpenQuery "qryCounter", acViewNormal, acEdit

End If

End If
DoCmd.Close
[Forms]![frmStore].Requery
[Forms]![frmStore]![comboJob].Requery

End Sub
 

dcx693

Registered User.
Local time
Today, 05:00
Joined
Apr 30, 2003
Messages
3,265
But if I try on any other computer on the network even with my admin login it doesn't work.
What doesn't work?

Based on your code, I'm guessing that your use of the .text property may be causing some issues. The text property is usually used to reference the unsaved data typed into a text or combobox. The saved is referenced using the .value property. Since the .value property is the most commonly used property of controls, it's the default and doesn't need to be specified explicitly. Try using this instead:
Code:
If [Forms]![frmStore]![Trace] = "T-***" Then
and
Code:
If Forms![frmStore]![Trace] = "N/A" Then
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:00
Joined
Feb 28, 2001
Messages
27,148
I tried to answer this earlier but my network hiccupped. I see this as one of two problems. I disagree (slightly) with DCX on pointing to the .text property, though there might well be a design issue there. But that should not contribute to asymmetric behavior on two PCs.

I see this as one of two possible problems.

1. Permissions difference between your PC and the "other" PC.

2. References difference between your PC and the "other" PC.

You need to look at the effective permissions on the file as seen from the two PCs to determine if there is a difference. You want to look not only at the DB itself, but also perhaps at the directory (folder) that holds it.

You also need to open up code windows so you can click on Tools >> References to see which references are checked and the order in which the checked references appear. If they are different on the two machines, that could also do it. The issue here is that it is not enough to say that both systems are running WinXP and AcXP. The OfficeXP options you installed on both machines must also be the same. More specifically, if you did a default install on your system, you must do a default install on the "other" machine to be able to say their configurations are the same. And the problem is the myriad choices available for an OfficeXp install, including several wizards, several libraries, and several applications that are optional.

The problem with references is that they are stored in your registry, which can of course be different on the two machines. They are in your registry under the HKEY_LOCAL_USER hive; I would have to do some research to be more specific. But the point is, two machines, two registries. They can EASILY be different, leading to different results.
 

Brian Martin

Registered User.
Local time
Today, 10:00
Joined
Jul 24, 2002
Messages
68
Thankyou for all your suggestions but I have fixed the problem although I don't know why it was a problem. The queries activated by clicking the button used data from two textboxes on the form. I didn't need the user to see these text boxes so I shrunk them right down and hid them behind another text box, I didn't make them invisible. I tried moving them from behind the other text box and expanding them so the user could see the data and for some reason it then worked. Strange because I have similar other similar setups on other forms in my database.
Can anyone explain the reason this worked?
 

Users who are viewing this thread

Top Bottom