Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some Users Unable to use command button

Status
Not open for further replies.

fredka

Technical User
Jul 25, 2006
114
US
I have users in two locations. Only the users in one location are unable to use command buttons that run reports. Two weeks ago all was fine. I really think this is a network issue since 1. two weeks ago the users were fine 2. the users in the other office are fine.

Here is the code for the command button and function used by the command button - looking for any ideas if this could be something that is being caused by the database and not the network? thanks!!!!:

'loops through the masterbrokerselect list box to make sure at lease one broker
'is selected - if at lease one broker is selected, the report is run, otherwise
'the user gets a messagebox to select at lease one broker
With Me.MasterBrokerSelect
For Each Ditem In .ItemsSelected
If Not IsNull(Ditem) Then
Dlen = 1 + Dlen
End If
Next
End With

If Dlen >= 1 Then
'call brokerfilter function (in the form module) to create the report
'filter based on the brokers selected in the masterbrokerselect list box
strWhere = brokerfilter
'run report using filter
DoCmd.OpenReport "rptVerifyMonthProdSISVsAccess", acViewPreview, , strWhere
Else
MsgBox "you must select at lease one broker"
End If

Here is the code for brokerfilter function:

Dim strWhere As String

'call brokerfilter function (in the form module) to create the report
'filter based on the brokers selected in the masterbrokerselect list box
strWhere = brokerfilter

'run report using filter
DoCmd.OpenReport "rptVerifyMonthlyProdAccess", acViewPreview, , strWhere

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:

'This code is added so that I do not get the "event cancelled" message
'box when the report is canceled due to no data
If Err.Number <> 2501 Then MsgBox Err.Number & ": " & Err.Description, vbExclamation
Resume Exit_Command5_Click
 
Here is the code for brokerfilter function:
...
strWhere = brokerfilter
...


No stack overflow with a so crude recursion ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV, I don't understand what you are saying??

thanks!!

 
Sorry, now I see what you are saying... my paste was incorrect in the original - here is the broker function - it just sets the filter:



Dim vitem As Variant
Dim lnglen As Long
Dim strWhere As String

'loops through the brokers that are selected in the masterbrokerselect list box
'adds each broker that is selected to use in a where clause
'to use as a filter for the sisvsaccess reports
With Me.MasterBrokerSelect
For Each vitem In .ItemsSelected
If Not IsNull(vitem) Then
strWhere = strWhere & """" & .ItemData(vitem) & ""","
End If
Next
End With
lnglen = Len(strWhere) - 2 'Without trailing comma and space
If lnglen > 0 Then
strWhere = "[broker] IN (" & Left$(strWhere, lnglen) & """" & ")"
'run report
End If
brokerfilter = strWhere
End Function
 
I was saying that I doubt the code you've posted is the code of the brokerfilter function.

Furthermore you didn't explain us what going wrong:
any error message ? any line of code highlighted when in debug mode ? application crash ? ... ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV - what is actually going wrong is that when the users in one of the offices here click the button, nothing happens at all. However, everything works fine for this office-

I am almost certain that it does not have anything to do with the database but has to do with the server or some type of network issue.

I just wanted to ask if it actually could be something in my database that causes some users not to be able to run the code but not all. The other thing is that 2 weeks ago, they were running the code without problem. I know our company is alway changing things... for example, we cannot sent .exe or .zip files internally anymore.

thanks!!!!!!

Fred
 
Could their security settings in Access not be letting them run the code?
 
menu Tools -> Macro -> Security

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Everything is was to low - Just as I test, I had the user go in and look again, it was set to low. I asked them to change to med and then back to low...when they try to change it to medium they get a message that says:

"Microsoft Office Access Microsoft Office Access cannot change the registry setting that controls whether or not unsafe expressions are blocked

Your account is not authorized to change this registry setting. To change this setting, contact your system administrator."

This has to be something network or computer based, correct? thanks so much for the help!!

Fred

 
I just received an email stating that they fixed the problem so it was not a database issue. I am waiting to hear back what exactly the problem was.

Thanks for your help!!!

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top