Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MS Access 2k7 VBA problem, property will not change

MS Access 2k7 VBA problem, property will not change

Scheduled Pinned Locked Moved Visual Basic
helpquestiondatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BREdwards
    wrote on last edited by
    #1

    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 = False

    The 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?

    C 1 Reply Last reply
    0
    • B BREdwards

      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 = False

      The 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?

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      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?

      B 1 Reply Last reply
      0
      • C ChandraRam

        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?

        B Offline
        B Offline
        BREdwards
        wrote on last edited by
        #3

        I have a copy of the .mdb file on my own machine along with office 2k7, approximating the same environment and I have determined that the property will change as it should after stepping it. Truly bizzare.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups