Results 1 to 7 of 7

Thread: [RESOLVED] error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

  1. #1

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Resolved [RESOLVED] error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    i am using a function in a module to open a form and add lines of code to the form's module. when i try to save the form using "DoCmd.RunCommand acCmdSaveRecord" i get the error "The command or action 'SaveRecord' isn't available now". what is stopping me from saving?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    You are opening the form in design mode?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    yes.
    should it be opened in a different way? i was sure it needed to be design mode to edit the code in the form's module.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    Can you post some relevant code?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    VB Code:
    1. Dim frm As Form, db As Database, con As Container, doc As Document
    2. Dim mdl As Module
    3.  
    4. Set db = DBEngine(0)(0)
    5. Set con = db.Containers("Forms")
    6.  
    7. For Each doc In con.Documents
    8.     DoCmd.OpenForm doc.Name, acDesign
    9.     Set frm = Forms(doc.Name)
    10.     Set mdl = frm.Module
    11.  
    12.     'add code to form's module here
    13.  
    14.     DoCmd.RunCommand acCmdSaveRecord
    15.     DoCmd.Close acForm, doc.Name
    16.  
    17. Next
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    Even though your opening the Form in design view, you actually tieing up the connection when you modify the module code that
    is bound to the form. You need to try to modify it from the Application.VBE object. Checkout my CodeBank code on
    "VB6 - Modify VBA Macro Code From VB". It shouldnt be too much to modify it for internal VBA use.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: error: The command or action 'SaveRecord' isn't available now (MS-Access 2003)

    great!

    thanks for the help.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width