code_junkie

Running code before any forms open in Access

Nov 11th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Me.Visible = False
  2. 'Determines if the database window is displayed
  3. SetProp "StartupShowDBWindow", False, dbBoolean
  4. 'Hide hidden and system objects
  5. SetOption "Show Hidden Objects", False
  6. SetOption "Show System Objects", False
  7.  
  8. 'Find back end
  9. CheckLinkPath
  10.  
  11. Set RS = CurrentDb.OpenRecordset("Select TableName From sysTables " _
  12. & "WHERE TableType = 'LINK'")
  13.  
  14. RS.MoveFirst
  15. strConnect = db.TableDefs(RS!TableName).Connect
  16. If Not FileExists(Mid(strConnect, InStr(strConnect, "DATABASE=") + 9)) Then
  17. 'All is not well
  18. blnConnectError = True
  19. Else
  20. Do Until RS.EOF()
  21. If db.TableDefs(RS!TableName).Connect <> strConnect Then
  22. blnConnectError = True
  23. Exit Do
  24. End If
  25.  
  26. RS.MoveNext
  27. Loop
  28. End If
Add Comment
Please, Sign In to add comment