473,508 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A date problem?

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
2 1388
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4829
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
7
8822
by: martini | last post by:
Need help: I am trying to call a DB2 stored procedure that requires parameters: 4x int, date, varchar, int. I use VB6 & oledb. I'm using statements: cmd.CommandText = "{call db2admin.proc(1, 0,...
11
4202
by: David B | last post by:
I have 2 querys with the following in the date criteria Between DateAdd("m",-6,(!!)) And (!!) Between DateAdd("m",-24,(!!)) And DateAdd("m",-6,(!!)) Problem is they both look at the same...
3
3607
by: Dustin Wilson | last post by:
I have a problem with the following line of code. rstOutput! = FormatDateTime("January 1, 2004", vbLongDate) When I run this on my computer at home it runs without problem but when I run it at...
3
11569
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
2
6501
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
1
2819
by: TN Bella | last post by:
Hello, I was looking through the older posts for a solution to this problem, but I am still confused on how to fix my problem. There are two dates on my form, one (txtInvDate) is entered by the...
7
31791
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
13
10679
by: Jim Armstrong | last post by:
Hi all - This problem has been driving me crazy, and I'm hoping the answer is something stupid I am neglecting to see.... The procedure posted below is part of an Access/SQL database I have...
7
2085
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.