Unable to set .SubDateSheetName=[None]

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • (PeteCresswell)

    Unable to set .SubDateSheetName=[None]

    Same DB, same table, two different PCs.
    --------------------------------------------------------------
    PC #1, I'm able to do it, no problem.

    PC #2, will let me do it and close the table with no error messages,
    but when I open it again, it has reverted to [Auto].
    --------------------------------------------------------------

    Something about a service pack?

    --
    PeteCresswell
  • RoyVidar

    #2
    Re: Unable to set .SubDateSheetNa me=[None]

    (PeteCresswell) wrote in message
    <svuv92d8l13i3i g30446gq117joet f788u@4ax.com> :[color=blue]
    > Same DB, same table, two different PCs.
    > --------------------------------------------------------------
    > PC #1, I'm able to do it, no problem.
    >
    > PC #2, will let me do it and close the table with no error messages,
    > but when I open it again, it has reverted to [Auto].
    > --------------------------------------------------------------
    >
    > Something about a service pack?[/color]

    When I encounteered it, I thought it was due to Access version. I think
    in Access 2003, I had to set it programatically , while in 2000 and
    2002, I could do it in design view.

    currentdb.table defs("yourtbl") .properties("su bdatasheetname" ).value =
    "[none]"

    --
    Roy-Vidar


    Comment

    • (PeteCresswell)

      #3
      Re: Unable to set .SubDateSheetNa me=[None]

      Per RoyVidar:[color=blue]
      >When I encounteered it, I thought it was due to Access version. I think
      >in Access 2003, I had to set it programatically , while in 2000 and
      >2002, I could do it in design view.
      >
      >currentdb.tabl edefs("yourtbl" ).properties("s ubdatasheetname ").value =
      >"[none]"[/color]

      That did the trick... Thanks!

      =============== =============== =============== =============
      Public Sub SubDataSheetZap ()

      Dim thisDB As DAO.Database
      Dim curTD As DAO.TableDef
      Dim newProp As DAO.Property
      Dim i As Long
      Dim k As Long

      Const myNone = "[None]"
      Const newPropName = "SubDataSheetna me"

      DoCmd.Hourglass True

      Set thisDB = CurrentDb()

      SysCmd acSysCmdInitMet er, "Zapping SubDataSheet Names...",
      thisDB.TableDef s.Count
      For i = 0 To thisDB.TableDef s.Count - 1
      Set curTD = thisDB.TableDef s(i)
      If Left$(curTD.Nam e,4) <> "Msys" then
      If tablePropExist( newPropName, curTD) Then
      curTD.Propertie s(newPropName) = myNone
      Else
      Set newProp = curTD.CreatePro perty(newPropNa me, dbText, myNone)
      curTD.Propertie s.Append newProp
      Set newProp = Nothing
      End If
      End If
      k = k + 1
      SysCmd acSysCmdUpdateM eter, i
      Next i

      SysCmd acSysCmdRemoveM eter
      Set curTD = Nothing
      Set newProp = Nothing
      DoCmd.Hourglass False
      MsgBox k & " tables updated", , "Done"
      End Sub

      Private Function tablePropExist( ByVal thePropName As String, ByRef theTD As
      DAO.TableDef) As Boolean
      Dim myProp As DAO.Property

      On Error Resume Next
      Set myProp = theTD.Propertie s(thePropName)
      On Error GoTo 0

      If Not myProp Is Nothing Then
      tablePropExist = True
      End If
      End Function
      =============== =============== =============== =============
      --
      PeteCresswell

      Comment

      Working...