Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incorrect Date Criteria in report

Status
Not open for further replies.

AnalystDBA

Programmer
Jan 2, 2002
20
0
0
AU
I have an Access report based on criteria entered by the user.
The problem I have may not necessarily be Access related.
When I run the report on my machine the report opens fine with the correct information.
When someone else tries to run the report on their machine the report does not return the correct information.
The dates in the report are not within the date range specified by the user.

The following lines of code opens the report
the variables 'stdate' and 'eddate' are pulled from controls on a form

DoCmd.OpenReport stDocName, acPreview, , "last_del_date between #" & stdate & "# AND #" & eddate & "# and territory_code like '" & SelTerr & "' AND maingrp_code like '" & SelMain & "' AND prodgrp_code like '" & SelProd & "' and ware_code like '" & SelWare & "' and ord_ind like '" & SelOrd & "' and status_ind like '" & SelStat & "' and part_code like '" & SelPart & "'"


Heres the catch, When I log onto the other users machine using my logon the report works fine.
If the other user tries to log onto my machine using their logon the report fails.

This has got me stuffed.

Can anyone help?

Cheers
AnalystDBA
 
(a) Make sure that you have consistent Regional Date settings in Control panel. Perhaps the settings for you and the other users are different. Try entering #1/1/01# to #3/3/01# for you and other users, and see if it works. If it does, then probably a regional setting problem, where its getting mixed up betweent the day and the month positions.

(b) In queries, dates must always be entered in mm/dd/yy format, when entered between the # symbols. I prefer to use the CVDate function, passing a string into the function.

Hope this helps,
Cheers,
Steve
 
Steve,
Thanks for the reply.

I have checked the regional settings however this should not effect the query as Access converts any date to a serial number regardless of the format.
The filter in the open report command has the dates enclosed in # and the controls on the form that I have assigned the date variables to are formatted as type 'Date'.

I looked at the .inf file that is accessed when a user logges onto their machine as I thought this might be the cause.

When I overwrote another users file with my .inf file it seemed to work for them.

The .inf file seems to set application settings at a user level when you log onto your machine. I don't think the settings are stored in the .inf file itself but instead in other files that the .inf file calls

The .inf file is stored in WINDOWS>PROFILES>[Profile Name]>APPLICATION DATA>MICROSOFT>OFFICE
We run Windows 98 and MS Access 97

Their is also an identical .inf file stored in the users Home directory on the network.

If you or anyone else can help at all with this it would be greatly appreciated.

Thanks.

Cheers,
AnalystDBA
 
AnalystDBA,

Alas, I'm just a humble programmer. I've never run into this sort of situation before. Does the problem manifest itself if you use numbers <= 12 for the day and month; ie. is it related to the order of day and month ? If you've isolated it to the inf file, have you identified the difference between your inf file and their file(s). Obvious questions I know.

Afraid I've reached my limit of incompetence as far as this one is concerned.

Good luck,
Steve
 
Steve,

I checked both of these and nothing obvious stuck out.

Thanks for your help anyway.

I guess its back to the drawing board :eek:)

Have fun programming Steve.
Cheers

AnalystDBA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top