By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

A date problem?

P: n/a
I want to select records which meet different criteria. I have a combo box
which takes the dates from the table containing the records. I select the
date from the menu, then open the form which meats the relevant criteria.

Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "Incidents"
stLinkCriteria = "[Incidents]![IncDate]=" & "#" & Me![Combo23] & "#"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

The records go back over the past few weeks. Up until the start of Feb it
can select the right dates ... but then it fails.

I'm afraid it is a total mystery to me. I've been everywhere trying to
solve it ... and ended up with my computer believing it to be 1890!

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Just a wild guess as this problem seems a bit odd but perhaps its a some
problem between date formats. Try using something like
stLinkCriteria = "[Incidents]![IncDate]=" & "#" & format (me![Combo23],"DD
MMM YYYYY") & Me![Combo23] & "#"
in your expression
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:c0*******************@news.demon.co.uk...
I want to select records which meet different criteria. I have a combo box which takes the dates from the table containing the records. I select the
date from the menu, then open the form which meats the relevant criteria.

Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "Incidents"
stLinkCriteria = "[Incidents]![IncDate]=" & "#" & Me![Combo23] & "#"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

The records go back over the past few weeks. Up until the start of Feb it
can select the right dates ... but then it fails.

I'm afraid it is a total mystery to me. I've been everywhere trying to
solve it ... and ended up with my computer believing it to be 1890!

Nov 12 '05 #2

P: n/a
On Sat, 7 Feb 2004 16:25:21 -0000, "John M" <jo**@jmawer.demon.co.uk>
wrote:

Perhaps Incidents.IncDate is not a date field but a text field? That
would be bad, but could possibly explain this behavior.

It could also be that Combo23 is rejected because it is not
self-describing. Try cboIncDate :-)

Also set a breakpoint on the DoCmd line and inspect the value of
stLinkCriteria. Is it really what you expected?

This is not a European Date Format vs USA Format issue, right? There
are some areas in Access where mm/dd/yyyy is the only accepted format.

-Tom.

I want to select records which meet different criteria. I have a combo box
which takes the dates from the table containing the records. I select the
date from the menu, then open the form which meats the relevant criteria.

Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "Incidents"
stLinkCriteria = "[Incidents]![IncDate]=" & "#" & Me![Combo23] & "#"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

The records go back over the past few weeks. Up until the start of Feb it
can select the right dates ... but then it fails.

I'm afraid it is a total mystery to me. I've been everywhere trying to
solve it ... and ended up with my computer believing it to be 1890!


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.