Solved

Issues with running database with access 2010 runtime

Posted on 2014-10-23
2
265 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 84

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

752 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