Usage of temp var in query criteria

Fred_Lapa

New member
Local time
Today, 22:49
Joined
Apr 29, 2019
Messages
2
Hello All,

My name is Fred, I'm Portuguese and new in this forum.

I'm about to start using Access in my local business and after splitting the DB and placed the back end file into the server and copying the front end into the desktop's of the local
users I found an issue related with temporary variable when I click in button that performs the following actions:

1- Sets a temporary variable (tmpMesdesp) in a main form that saves the month year selected by the user in a text box

2- Runs a query with the month year criteria [TempVars]![tmpMesdesp] and display the result in a subform

The application was developed with Access 2013 (English language package) and for the users that are running Access 2013 in Portuguese the query is not displaying any result.

However, when running it in Access 2013 in English all is fine and the query returns the correct results.

Does anyone have any clue for this behavior

Thanks in advance,

Fred
 
Hi Fred. Welcome to the forum. Are you talking about users with different Regional Settings? If so, there is a difference if one user is set to U.S. and another to something else with a different format for dates. The U.S. uses mm/dd/yyyy. Are you using something like dd/mm/yyyy?
 
Last edited:
First, Fred - welcome.

Second, and this is not a slam, just a passing note: The Intro forum is where you say Hi but you post other questions in more topically oriented sections. Don't be surprised if some moderator chooses to move this to the Queries forum.

Third, you say that you have month & year criteria. To know what is wrong, we would need to see the actual query. We would also need to know the format of the data in the table being queried AND the typical format of the data in the text box that you use as the source of your temporary variable.

theDBGuy is probably right that it is based on a difference in regional settings, but it would help if we could determine where a date conversion is occurring. That point is where you run into issues.

As a side note, you SHOULD be able to reset your machine's regional settings to match those of one of the miscreant systems, then start the process with a breakpoint in the code at the point where you begin processing that information. You can check along the way to see how your data has been altered by hovering the mouse cursor over the variable names in the lines of code. Alternatively, in the Immediate window, you could use Debug.Print variable-name to see the current value of your tempvars, SQL string, and whatever else is relevant.
 
Hello Guys,

Thanks a lot for your replies.

The issue was indeed related with the regional settings.

I've changed the date format from dd-mm-aaaa to dd/mm/aaaa and all is working fine now.

Best regards,

Fred
 
Hello Guys,

Thanks a lot for your replies.

The issue was indeed related with the regional settings.

I've changed the date format from dd-mm-aaaa to dd/mm/aaaa and all is working fine now.

Best regards,

Fred
Hi Fred. Glad to hear you got it sorted out. The Doc and I were happy to assist. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom