MS Access 2k7 VBA problem, property will not change
-
I have a user for whom a VBA application in MS Access ceased to work properly after upgrading to office 2k7. I stepped through the VB code and this is what I am seeing in the Form_Current sub: Consider the following If Statement:
If Nz(Me!PID) = 0 Then
Me.Attachments.Form.RecordSource = "Select attach from attachments where pid = " & Me!IssID & " AND [ISSUE_ONLY]=1;"
Text114.Visible = False
Label119.Visible = False
Text128.Visible = False
Label129.Visible = False
Else
Me.Attachments.Form.RecordSource = "Select attach from attachments where pid = " & Me!PID & " AND [ISSUE_ONLY]=0;"
Text114.Visible = True
Label119.Visible = True
Text128.Visible = True
Label129.Visible = True
End If
Me.Attachments.Form.Requery
Me.Attachments.Form.AllowDeletions = FalseThe Me.Attachments.Form.RecordSource property, normally should change after being explicity set like that, but on this user's machine, it isn't. The propery is remaining "attachments" returning the entire table instead of what is specified in the query. This only seems to be happening for this user so far so I don't think it is a code issue. The .mdb file itself is not read-only and is up to date as far as I can tell. The Trust center settings also appear to be correct as well, allowing macros to be run. No errors are thrown when the code attempts to change the recordsource property, only that nothing happens and the property remains unchanged. Any ideas?
-
I have a user for whom a VBA application in MS Access ceased to work properly after upgrading to office 2k7. I stepped through the VB code and this is what I am seeing in the Form_Current sub: Consider the following If Statement:
If Nz(Me!PID) = 0 Then
Me.Attachments.Form.RecordSource = "Select attach from attachments where pid = " & Me!IssID & " AND [ISSUE_ONLY]=1;"
Text114.Visible = False
Label119.Visible = False
Text128.Visible = False
Label129.Visible = False
Else
Me.Attachments.Form.RecordSource = "Select attach from attachments where pid = " & Me!PID & " AND [ISSUE_ONLY]=0;"
Text114.Visible = True
Label119.Visible = True
Text128.Visible = True
Label129.Visible = True
End If
Me.Attachments.Form.Requery
Me.Attachments.Form.AllowDeletions = FalseThe Me.Attachments.Form.RecordSource property, normally should change after being explicity set like that, but on this user's machine, it isn't. The propery is remaining "attachments" returning the entire table instead of what is specified in the query. This only seems to be happening for this user so far so I don't think it is a code issue. The .mdb file itself is not read-only and is up to date as far as I can tell. The Trust center settings also appear to be correct as well, allowing macros to be run. No errors are thrown when the code attempts to change the recordsource property, only that nothing happens and the property remains unchanged. Any ideas?
BREdwards wrote:
This only seems to be happening for this user so far so I don't think it is a code issue.
Does that mean the same code changes the form RecordSource property for other users?
-
BREdwards wrote:
This only seems to be happening for this user so far so I don't think it is a code issue.
Does that mean the same code changes the form RecordSource property for other users?