Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    89

    Unanswered: Code works in MS Access but not in MS Access Runtime manager

    Hello
    I have an database that works fine when run in MS Access 2013 but when run in MS Access Runtime 2013 the app gives a runtime error.
    The piece of code it where it is getting the error on is: 'If Me.frmSUBform.Form.Recordset.RecordCount = 0 Then'
    _________________________________________________
    Explanation on what happens:
    I have a table with data that is imported from the Global Catalog list. (called: tblGLOBAL)
    On a form there is a txtbox (Contact person) that will search in the table thru a query. (called: qryGLOBAL)
    The qryGLOBAL contains 3 columns, Firstname, Lastname, Accountname.

    After the lost focus from the txtbox (Contact person) the form with on that an subform that is the qryGLOBAL.
    After the On Timer action the subform that is the qryGLOBAL will get an requery that shows data that is simular to the txtbox (Contact person).
    The query searches thru the 3 columns (Firstname, Lastname, Accountname)

    If the data in the txtbox (Contact person) is not like any input (Firstname, Lastname, Accountname) the query will be empty then the command 'If Me.frmSUBform.Form.Recordset.RecordCount = 0 Then' will close the searchform (based on qryGLOBAL) and give an MSG that there is no contact person like the search in the database.
    _________________________________________________
    I hope someone can direct me to a solution around this error so i do have to change to much of the structure.

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    i noticed runtime will not accept certain commands.
    Instead of your code, use Dcount in a field, then its just :
    IF me.txtRecCount = 0 then

    or another variation.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    And tgh runtime error is?

    Its a long, long time since I used runtime, and never runtime 2013 but in my experience you need to be explicit as to which recordset library you use. Make certain the runtime is configured / built correctly
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    May 2012
    Posts
    89
    Quote Originally Posted by healdem View Post
    And tgh runtime error is?

    Its a long, long time since I used runtime, and never runtime 2013 but in my experience you need to be explicit as to which recordset library you use. Make certain the runtime is configured / built correctly
    I do not get an error,the only thing it gives my is: "an error occurred and the application has to end" or something like this, no error number or anything.

    I have made it different so the user knows enough that the input gives no output...
    Now if made it that if the query is empty it shows a record that says that no contacts match the search, and the form stays open.

    I do not have time to figure it out now, but thanks for the help anyways

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so place some error handling code around the block that is causing the error

    'does not work' is not ever a good enough starting point to debug code.


    the fact you don't know which line is faulting / throwing the error is indicative that you haven't really done enough investigation to work out where the error is, beyond being somewhere vaguely in your code.

    you don't provide the query
    the table design....

    you are making it virtually impossible that you will find the fault and almost certainly impossible that anyone else could help you find it
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by
    Rubberducksucker
    I do not get an error,the only thing it gives my is: "an error occurred and the application has to end" or something like this, no error number or anything.


    That's a major drawback to using Runtime...any unhandled error, rather than popping an error message and giving some clue as to the nature of the problem, simply reports that an error has occurred and then closes the database down.

    Because of this it is absolutely essential that you have error handlers in place. Of course, the fact that the code runs sans problems, in a full version of Access, and only errors out in Runtime, is going to be especially hard to debug.

    Is this a split database? If so, one thing to consider is whether or not the errant machine has the appropriate privileges needed to access the Back End.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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
  •