UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Date & Possible Runtime Issue, Access 2016    
 
   
tobyhanna
post Feb 7 2018, 08:59 AM
Post#1



Posts: 131
Joined: 7-February 06



Hello,

I have an application, split FE & BE, that the user wants to run using Access Runtime. I develop in Access 2016 and save to ACCDE. We use Access Runtime 2013 32-bit because of the Click-to-Run issue.

I use dates to display today's date and in functions that determine another field's value. Such as, if ReviewDate <= Today's Date, Status = "DUE". ReviewDate is a date/time field. I also have queries that update Status based upon this same caluclation. The queries work for me but not for my client, even when I'm running in Runtime mode. Could it be Runtime and my machine just compensates because I have Access installed? Could it be the client uses dates displayed as "d/m/yyy" and I have today's date = cdate(format(now(),"m/d/yyyy"))? I tried cdate(format(now(),"short date")) but that was not successful on the client's machine.

I took away references and use late binding. Perhaps I have not taken away enough references. What's left is:
Visual Basic for Applications
Microsoft Access 16.0 Object Library
OLE Automation
Microsoft ADO Ext. 2.8 for DLL and Security
Microsoft Office 16.0 Access database engine Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft ActiveX Data Objects 6.1 Library

The client isn't receiving errors, the date functions are simply not working as expected or the same as on my machine. The client ran update queries which "fixed" my data but not his. Has anyone seen this with Access Runtime or am I missing a crucial piece?

Thank you,
Liesl
Go to the top of the page
 
BruceM
post Feb 7 2018, 10:16 AM
Post#2


UtterAccess VIP
Posts: 7,448
Joined: 24-May 10
From: Downeast Maine


It would help to see the actual criteria statement. I suspect what you seem to: that the date format is different on the client's machine. You may need to coerce the dates into either mm/dd/yyyy (or m/d/yy etc.) format, or use yyyy/mm/dd.

Without seeing what you tried I can only make a general suggestion that the criteria need to be something like:

"Where DateField < " & Format(Date(),"\#yyyy\/mm\/dd\#")

If you are wondering about references, try removing a reference and compiling the code. If it compiles without the reference, chances are you don't need it.
Go to the top of the page
 
GroverParkGeorge
post Feb 7 2018, 10:18 AM
Post#3


UA Admin
Posts: 32,821
Joined: 20-June 02
From: Newcastle, WA


I would recommend taking out the Format() elements. I can see what you're trying to do: Format a value as a plain date without a time, and then convert that back to a valid date since Format() results in a string.

Try THIS instead: DateValue(Date())

--------------------
Go to the top of the page
 
tobyhanna
post Feb 7 2018, 05:55 PM
Post#4



Posts: 131
Joined: 7-February 06



Thank you Bruce and George. I will try DateField < CDate(DateValue(Now())). It definitely works on my local setup. I'll hear soon if it works at the client.

Liesl
Go to the top of the page
 
BruceM
post Feb 8 2018, 07:34 AM
Post#5


UtterAccess VIP
Posts: 7,448
Joined: 24-May 10
From: Downeast Maine


I would just use Date() instead of DatePart(Now()), I think. Also, since Date() returns a date value, I don't see the need for CDate, which is used to convert a non-date value into a date.

If DateField < CDate(DateValue(Now())), or DateField < Date(), is part of a criteria statement (Where condition), try adding a message box to show the criteria string, to see the actual value being applied on the client's machine.

Again, it would have helped to see the actual statement that is causing the problem, and more detail about the problem than that the query doesn't work. Does the query produce errors? Incorrect results? No records?

Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    21st June 2018 - 06:53 PM