none
How do I save a form as part of a access template in access 2013 64 bit win7 64bit RRS feed

  • Question

  • I have stumbled on by accident, a way to save a form and have it be the form (frmStart) that access opens on start of opening the database.

    Saving as a template   an   accdt   file.          But I have NOT figured out how to do that when I want to,

    Also trying to have a Table with data in the table ALSO saved with the Template.

    So when I use the template to start a new database. The new database will start off with the form frmStart    and the tableStartingData.

    I would almost be as happy about the tableStartingData  IF all I could include in the template was the table  tableStartingData  with all settings if without any records.

    By the way, I know it is possible to have a template that when used to create a NEW database, will add the form to the Navigation plane because on creating of NEW database I see frmStart in the Navigation Pane. 

    I am posting this question due to the fun part. Before the autoexc is finished setting all the options, and I click on  “Stop All Macros”  in “Macro Single Step”   Macro Name”  AutoExec     Action Name: RunCode   Arguments: MySetOpptions()    Error Number: 2001 

    frmStart is showing under Forms in Navigation pane

    then the from disappears from “All Access Objects” list

    Then I get a security warning   some active content has been disabled  I click on “Enable Content” button.

    I get the msg file does not exist or misspelled.

    But in Project view    shows  under  aaTemplateName(currentDataBaseName)

    Just like basUtil my standard module holding all the code I want to run to    run    Application. Set Option   settings.

    Left or Right click on  Form_frmStart   ONLY gets msg  file Not found.   And unable to delete Form_frmStart  in Project View.

    Could NOT find macro that referred to the form.  I did set   the access under file / access options / Current Database / Display form / frmStart in the template before I saved as a template.

    I would even be happy on hints on what to look for that would cause the form to disappear AFTER it shows up in the navigation pane.

    Not surprised when something does not show up, usually it is my typo, the disapering after it shows up without anything I know would make the form disappear is interesting.

    Mark J


    Mark J

    Wednesday, September 14, 2016 12:42 PM

Answers

  • Hi,

    If I create a custom template saved as accdt, I could reproduce your issue.

    While I create the template saved as accdb, the frmStart would not disappear.

    I suggest you customize the template saved as accdb and in System template folder  C:\Program Files\Microsoft Office\Templates\1033\Access.

    Tuesday, September 20, 2016 10:53 AM
    Moderator
  • Hi,

    Please visit  Create a custom blank template, you could find:

    In the Save As dialog box, browse to one of these two template folders:

    System template folder    For example, C:\Program Files\Microsoft Office\Templates\1033\Access

    User template folder    For example:

    In Windows Vista    c:\Users\user name\AppData\Roaming\Microsoft\Templates

    In Microsoft Windows Server 2003 or Microsoft Windows XP    C:\Documents and Settings\user name\Application Data\Microsoft\Templates

    Note: A blank template in the System template folder overrides blank templates in any user template folders.

     

    Sorry I didn’t clarify this.

    System template folder depends on the version of your Office,

    if you are using 64bit Office, you could find in C:\Program Files\Microsoft Office\Templates\1033\Access

    And if Office 32bit, you could find in C:\Program Files (x86)\Microsoft Office\root\Templates\1033\Access

    Besides, User template folder as what you are using now is alternative.

    Wednesday, September 21, 2016 2:41 AM
    Moderator

All replies

  • Hi Mark,

    Are you able to share a copy of your original file for examination?

    Wednesday, September 14, 2016 3:18 PM
  • .theDBguy,

    will try.

    have AutoExc macro  that only has MessageBox

    msg is "AutoExc Macro is starting"

    Then RunCode

      Function Name   MySetOptions()

    Option Compare Database
    Option Explicit

    Public Function MySetOptions()

    'MsgBox "this to run in autoExec Macro.  Must be in function but NO return value!"

    'MsgBox "setOptions Here"
      ' https://msdn.microsoft.com/en-us/library/office/ff823177.aspx
    Dim strAnswer As String

    Application.SetOption "Track Name AutoCorrect Info", False
    Application.SetOption "Perform Name AutoCorrect", False

    Application.SetOption "Left Margin", 0.3


    Application.SetOption "CheckTruncatedNumFields", True

    Application.SetOption "Confirm Record Changes", True
    Application.SetOption "Confirm Document Deletions", True
    Application.SetOption "Confirm Action Queries", True

    Application.SetOption "Four-Digit Year Formatting All Databases", True

    Application.SetOption "Always Use Event Procedures", True

    ' Default Font Color
    Application.SetOption "Default Font Color", vbBlack


    'MsgBox "error level traping here"

    ' break on all errors         0
    'break in class modulles         1
    'break unhandled errors      2

    strAnswer = InputBox("Enter 1 to break in class modules, Enter 2 to break on unhandled errors, default is 0 break on all errors even if have error handling code", , 0)


    Application.SetOption "error trapping", CInt(strAnswer)

    Debug.Print "cint(stramswer)= " & CInt(strAnswer)

    'MsgBox "Error Level Trapping is zero, Break on all errors even if have error handling code"

    MsgBox "finished setting options"

    End Function

    AND in Access File Tab / Options / Current Database / Display from / frmStart

    frmStart is name of form I created in accdb before I saved it as a personal template.

    It does show up under Personal templates in access.

    Mark J.


    Mark J

    Did get a macro error of 2001    msg like

    Macro Single Step

    Macro Name   AutoExec

    Action Name  RunCode      Arguments    MySetOptions()

    Stop All Macros   button is only one NOT greyed out.

    I can see just below the Ribbon  ! Security warning  Some active content has been disabled. Enable Content.

    When I click on button   Stop All Macros

    and click on that warning  goes to File / Info   msg is Active content might contain viruses the following content has been disabled     VBA Macros

    when I click on Enable Content   warning goes away, up pops msg  form name misspelled or missing. IF frm name is in a macro then when you click ok on msgbox an Action Failed msgbox will open. Does NOT.

    Mark J

    • Edited by PuzzledByWord Friday, September 16, 2016 12:28 PM More Info
    Friday, September 16, 2016 12:13 PM
  • Hi,

    If I create a custom template saved as accdt, I could reproduce your issue.

    While I create the template saved as accdb, the frmStart would not disappear.

    I suggest you customize the template saved as accdb and in System template folder  C:\Program Files\Microsoft Office\Templates\1033\Access.

    Tuesday, September 20, 2016 10:53 AM
    Moderator
  • Celest Li,

    Thanks for the info.

    Always nice on the ego, to know the problem is not because you are doing something wrong.

    Also thanks for the workaround.

    Mark J


    Mark J

    Wednesday, September 21, 2016 1:12 AM
  • Celeste Li,

    I couldn't find the spot

    System template folder  C:\Program Files\Microsoft Office\Templates\1033\Access

    after lots of looking. what I did as save DataBase10TemplateToDelete   as a Template  then got msgbox with msg file saved at below.   I just copied the location.  Might help others when unable to find where Microsoft is storing the templates.  if NOT where expected.

    C"\users\Mark\AppData\Roaming\MicroSoft\Templates\Access\

    Mark J


    Mark J

    Wednesday, September 21, 2016 2:28 AM
  • Hi,

    Please visit  Create a custom blank template, you could find:

    In the Save As dialog box, browse to one of these two template folders:

    System template folder    For example, C:\Program Files\Microsoft Office\Templates\1033\Access

    User template folder    For example:

    In Windows Vista    c:\Users\user name\AppData\Roaming\Microsoft\Templates

    In Microsoft Windows Server 2003 or Microsoft Windows XP    C:\Documents and Settings\user name\Application Data\Microsoft\Templates

    Note: A blank template in the System template folder overrides blank templates in any user template folders.

     

    Sorry I didn’t clarify this.

    System template folder depends on the version of your Office,

    if you are using 64bit Office, you could find in C:\Program Files\Microsoft Office\Templates\1033\Access

    And if Office 32bit, you could find in C:\Program Files (x86)\Microsoft Office\root\Templates\1033\Access

    Besides, User template folder as what you are using now is alternative.

    Wednesday, September 21, 2016 2:41 AM
    Moderator
  • I would have sworn I marked as answer on 9/21 1am doing that now.

    Mark J


    Mark J

    Friday, September 23, 2016 6:12 AM
  • Celeste Li,

    Thank you very much for the added info.

    I see what I think was my problem.

    Seems my official legal copy of win 7 and office 2013 both 64bit on install somehow installed the folders as if this was for windows vista (or as if I was not going to install office).

    1. Seems no system folder for templates was created. ( might be due to time between RE-install of win7 and re-install of office 2013.    Lot harder to find buy a legal product key for office 2013 win7 64bit, took a while to get.) 

    2. No folder "Microsoft"    BUT A folder "Microsoft 15"  without "Templates" or "1033"   I do remember seeing "1033" folder before I had to reinstall win7 and office. Might be due to difference in how programs were reinstalled.  This time NO Disk or USB Drive. ALL downloaded over net.      

    3. BUT Access stores my templates where I said and shows up under "Personal"  not "Featured" when I am going      to create a new database file. 

    4. Your saving the  accdb file not an accdt in the template folder was genius.  Works great.

    5. honest I didn't create my own folders to save templates.  I only used the folders that Access or Word decided to store the templates in.

    6. I did find an different folder called "Custom Office Templates"  It was completely empty

     found under Libraries/My Documents /Custom Office Templates      path.   

    7. Honest I did not do a "custom install" on either install.  But my product key might have been gathering dust since 2009 due to that the copyright date showed on install.

    Thanks again for adding to my knowledge, it seems I learn more about how things should be, and how to fix if not as it should be.

    Mark J


    Mark J

    Friday, September 23, 2016 7:18 AM