Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110

    2 issues with .accdr app

    I finished the app and created an install file (btw, thanks for letting me know about SSE Setup). The app runs fine unless I change it from an .accde to an .accdr. I do this just so the user won't accidentally mess with the data in the database. The two issues I now have are:
    1) when I start up the app, I get the error message: "No current record."
    2) If I try to open up a text form (all user documentation is done via text forms) I get the message: "The OpenForm action was canceled"

    suggestions?



    willkr

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is there any code in those forms that would try to put a form into design view perhaps? Can you attach a sample that exhibits the problem here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    There is nothing special about these forms as far as I can see. All one of these does is: move itself to the proper location on the screen and set the font for the form. Here is the code in one of them:

    Option Compare Database


    Private Sub Form_Open(Cancel As Integer)


    'SS_OnOpen Me
    Me.Move 11000, 500


    ' Set the Label font
    Me.Title.FontName = strReleaseFontName
    Me.Text1.FontName = strReleaseFontName

    End Sub


    '------------------------------------------------------------
    ' btnClose_Click
    '
    '------------------------------------------------------------
    Private Sub btnClose_Click()
    On Error GoTo Err_btnClose_Click


    ' Close form
    DoCmd.Close


    Exit_btnClose_Click:
    Exit Sub


    Err_btnClose_Click:
    MsgBox Err.Description
    Resume Exit_btnClose_Click

    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you attach a sample that exhibits the problem here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    I'm not exactly sure what you're asking for. Here is the code that calls the text form:

    '------------------------------------------------------------
    ' btnHelpCheckEntry_Click
    '
    '------------------------------------------------------------


    Private Sub btnHelpCheckEntry_Click()
    On Error GoTo Err_btnHelpCheckEntry_Click


    Dim stDocName As String
    Dim stLinkCriteria As String


    stDocName = "frmHelpCheckEntry"
    DoCmd.OpenForm stDocName, , , stLinkCriteria


    Exit_btnHelpCheckEntry_Click:
    Exit Sub


    Err_btnHelpCheckEntry_Click:
    MsgBox Err.Description
    Resume Exit_btnHelpCheckEntry_Click

    End Sub


    The error message is: "The OpenForm action was canceled."

    I only get the error message when the app is executed as an .accdr

    it works fine as an .accdb and as an .accde

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm hoping for a sample database I can play with to see if I can figure out why this happens.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    pbaldy,
    There are more than 60 tables in this database. It's not trivial to break it apart. The database when empty is more than 30 MB and the app is more than 100 MB. I was hoping that there was a simple reason why this is happening.

    willkr

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I understand. I thought maybe if one of those text forms would throw the error all by itself, you could just post one of those.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Paul,
    I don't know how to post just one form. Educate me.

    willkr

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Create a new database and export a single form into it (or import from it). Given your specific issue we'll probably need a startup form with a button to open it but that's easy for us to create.

    It would be nice to have the form that opens on startup too, but I'm guessing that one is bound to data. Hopefully if we solve one issue we solve the other.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Code:
    Option Compare Database
    
    
    Private Sub Form_Open(Cancel As Integer)
    You should also have Option Explicit declared.

    You probably have an error somewhere.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  12. #12
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    OK I have a simple form (FrmCheckEntry) with a single button. There is a "?" on the button. When I open the .accdb (called "Test1") I can open the form and click on the button. It works fine. However, the problem is with the .accdr version. When I execute the .accdr version there's no way to open the form. How do I make the app open a form when it starts up?

    I know this is pretty elementary stuff, but I haven't started an app from scratch in more than 20 years.

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    File/Options/Current Database/Display Form
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Oh, and you could also use an autoexec macro to open the starting form, but the above has become more common.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    The error message is: "The OpenForm action was canceled."
    implies a runtime error when you try to open the form - look in that form's open, load and current events for code. If it is the code you provided in post #3, try commenting out the code or changing the parameter values to see what happens. - perhaps the values provided to .move are invalid or out of scope in the windows environment you are using the .accdr.

    In post #5 you use a stLinkCriteria string variable as a parameter but never assign it a value - so assign a value or remove it

    As others have said, you should have option explicit at the top of each module to identify compilation errors - although if you are able to create a .accde it implies to code did compile.

    You do know you can just rename a .accdb to .accdr so you can test how you app will work in a runtime environment. That is the primary purpose for .accdr - a development aid. It is not intended as a security method as it can so easily be circumvented.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. .accdr won't open
    By merlin777 in forum Access
    Replies: 32
    Last Post: 09-27-2015, 12:04 PM
  2. ApplyFilter in ACCDR
    By Cedarguy in forum Access
    Replies: 5
    Last Post: 05-11-2015, 05:49 AM
  3. .accdr file issue
    By EdCanada in forum Access
    Replies: 20
    Last Post: 04-04-2014, 12:10 AM
  4. Allow additions on .accdr
    By dougie in forum Forms
    Replies: 0
    Last Post: 02-20-2012, 05:17 AM
  5. Performance of ACCDB vs. ACCDR
    By ser01 in forum Access
    Replies: 2
    Last Post: 06-13-2011, 08:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums