Solved

Issues with running database with access 2010 runtime

Posted on 2014-10-23
2
268 Views
Last Modified: 2014-10-26
I have a Access 2010 database with front-end and back-end. In normal configuration front-end is .accdb it works very well.
However when I change it to .accdr or open it with A2010 runtime it has issues.
Please help me with one issue and then I may understand what the problem is.
In the form below, when I select a "new activity" (red arrow) from the dropdown box, I get a message that a runtime error has occurred and the system will shut down.
That combobox has after update code associated which changes the date value in the "Date to Complete task" textbox.
Can a database not run code in the A2010 runtime?
Please look at my code below. Is there anything there that does not run in a runtime. It looks straight forward to me and it runs nicely in normal Access 2010

Where the problem starts.
Private Sub tbxActivity_AfterUpdate()
Dim lngDays As Long
Dim strMeActivity As String
Dim strWhere As String

    On Error GoTo UnknownActivity
    lngDays = DLookup("[NormalDaysRequired]", "tblActivities", "Description = '" & Me![Activity] & "'")
    tbxDateToComplete = tbxDateCreated + lngDays
End

GoTo Completed
UnknownActivity:
    tbxDateToComplete = tbxDateCreated + 1

Completed:
End Sub

Open in new window

0
Comment
Question by:Fritz Paul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40400066
Could be a number of things ... for example, your tbxDateCreated might be NULL, or something of that nature, or the DLookup might not return a value.

Also, you must handle all errors in a Runtime application, else you run the risk of this sort of thing happening. When running in full Access, your errors would be handled by Access, but you don't have that protection in the Runtime (or when running as an accdr). If the Runtime comes across an unhandled error, it just shuts things down.

I would also STRONGLY advise you to get away from GoTo coding, except for use with error handling. That sort of coding went out with QBasic, and can become extremely difficult to troubleshoot down the road.
0
 

Author Closing Comment

by:Fritz Paul
ID: 40405747
Thanks for the reaction to my question.

It was the first time that I gave someone a database to run under Access runtime, so I could not understand why the program just shut down.
After I read the answer, I went back to investigate. I added messages to show me the values the program was working with and added some error traps. I also got rid of the "Go To" code as suggested. I also located some more potential "issues" and fixed them.
Although I initially felt that the answer was a little blunt, I now appreciate the fact that it did lead me in the right direction and that I got the confidence to go forward.

The program is now running smoothly.

Thanks.
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question