Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Access runtime issue
Paul G 

10 years ago
Hi All
First post here so please take it easy on me.

I have a split database hosted on a server and access on a couple of machines pulling data from the split back end. Everything works great>
I have a couple of machines running access runtime 2016 and 2013 Almost every thin works fine apart from the date now function. Each time i run the application and select an employee the date now function give me execution of this application has stopped due to run time error, and closes application out.

I think i have got it down to the line of code.


Private Sub Employee_AfterUpdate()
  Me.Cdate = Format(Now(), "Medium Date")
End Sub


If i rem out that piece of code i can select an employee and carry on.

So i have a feeling it is to do with the date time of the local Runtime system not the runtime enviroment. I can force run time on a local server and everything works.

Can anyone tell me if there is a way or any code i could substitute so that the date is pulled direct from hosting server rather than local runtime system.

This way i am thinking if the server date time is pulled then there is a consistent date time rather than an off set from local machines that might be a minute or two out.

Hope this all make sense.

thanks for the help in advance.

this is the entire code of the form i am working with.

Option Compare Database

Private Sub attdate_Change()
If Not IsNull(Me.attdate) Then
    Me.AttendanceDate = Me.attdate
End If
End Sub

Private Sub ClockOut_AfterUpdate()
Me.thours = DateDiff("n", [ClockIn], [ClockOut]) / 60
End Sub

Private Sub Command22_Click()
DoCmd.RunCommand acCmdDeleteRecord
End Sub

Private Sub Command24_Click()
If Len(Me.date1) = 0 Or Len(Me.date2) = 0 Or IsNull(Me.date1) Or IsNull(Me.date2) Then
    MsgBox "Please select date range."
Else
    If IsNull(Me.femployees) Or Len(Me.femployees) = 0 Then
        Me.Filter = "cdate >= #" & Me.date1 & "# and cdate <= #" & Me.date2 & "# "
        Me.FilterOn = True

    Else
        Me.Filter = "cdate >= #" & Me.date1 & "# and cdate <= #" & Me.date2 & "# AND Employee = " & Me.femployees
        Me.FilterOn = True
    End If
End If

End Sub

Private Sub Command29_Click()
DoCmd.RunCommand acCmdPrintPreview
End Sub

Private Sub Command30_Click()
Me.FilterOn = False
Me.date1 = Null
Me.date2 = Null
Me.femployees = Null
End Sub

Private Sub Command47_Click()
  DoCmd.OutputTo acOutputQuery, "QRYEXPORTPAYROLL", acFormatXLSX,
CurrentProject.Path & "\payrollinfo_" & Replace(Me.date1, "/", "")
& "_" & Replace(Me.date2, "/", "") & ".xlsx", True
End Sub

Private Sub Command6_Click()
If Len(Me.Employee) = 0 Then
    MsgBox "Nothing to save."
Else
    DoCmd.Save
    DoCmd.Close acForm, Screen.ActiveForm.Name
End If
End Sub

Private Sub Command7_Click()

    DoCmd.Save
    DoCmd.GoToRecord , , acNewRec

End Sub

Private Sub Command9_Click()
Me.Undo
DoCmd.Close acForm, Screen.ActiveForm.Name
End Sub

Private Sub Employee_AfterUpdate()
Me.Cdate = Format(Now(), "Medium Date")
End Sub

Private Sub femployees_AfterUpdate()
Me.FilterOn = False
If Len(Me.date1) = 0 Or Len(Me.date2) = 0 Or IsNull(Me.date1) Or IsNull(Me.date1) Then
    Me.Filter = "Employee = " & Me.femployees
    Me.FilterOn = True
Else
    Me.Filter = "cdate >= #" & Me.date1 & "# and cdate <= #" & Me.date2 & "# AND Employee = " & Me.femployees
    Me.FilterOn = True
End If
End Sub

Private Sub Form_Load()
CurrentDb.Execute "delete * from tblattendance where isnull(AttendanceDate) or isnull(student) or isnull(presence);"
End Sub

Private Sub Student_Change()
If Not IsNull(Me.student) Then
    Me.AttendanceDate = Format(Now, "short date")
End If
End Sub



Reply from Alex Hedley:

Hi Paul,
Welcome to the forums :)

Was this db migrated?
It might be a references issue - VBA Editor - Tools menu

See this post for further help - Access Reference Problems

Alex

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/10/2026 11:14:43 AM. PLT: 0s