?
Solved

Issues with running database with access 2010 runtime

Posted on 2014-10-23
2
Medium Priority
?
274 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

719 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