473,395 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Where condition

Hi!
The following code give me an error message (syntax error 3075) and I can't
figure out what is wrong! Any suggestions?

Sigurd

Dim stDocName As String
stDocName = "rptFaktura"
Dim stLinkCriteria As String
stLinkCriteria = "[Invoicedate]= " & Date

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Nov 12 '05 #1
7 8383
On Fri, 3 Oct 2003 15:47:40 +0200, "Sigurd Bruteig"
<s-********@online.no> wrote:

Try this:
stLinkCriteria = "[Invoicedate]=#" & Date & "#"

-Tom.
Hi!
The following code give me an error message (syntax error 3075) and I can't
figure out what is wrong! Any suggestions?

Sigurd

Dim stDocName As String
stDocName = "rptFaktura"
Dim stLinkCriteria As String
stLinkCriteria = "[Invoicedate]= " & Date

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria


Nov 12 '05 #2

"Tom van Stiphout" <to*****@no.spam.cox.net> skrev i melding
news:dl********************************@4ax.com...
On Fri, 3 Oct 2003 15:47:40 +0200, "Sigurd Bruteig"
<s-********@online.no> wrote:

Try this:
stLinkCriteria = "[Invoicedate]=#" & Date & "#"


Thank you Tom, but it is still the same error. The date is correct it seems
(when i hold the cursor over the date it is displayed correctly).
[Invoicedate] is a field in a table, present in the report.

Sigurd
Nov 12 '05 #3
On Fri, 3 Oct 2003 15:47:40 +0200, "Sigurd Bruteig"
<s-********@online.no> wrote:

Dim stDocName As String
stDocName = "rptFaktura"
Dim stLinkCriteria As String
stLinkCriteria = "[Invoicedate]= " & Date

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria


Maybe stupid, but are you sure that the name [Invoicedate] is part of
your query behind the report?
--
bebelino
Nov 12 '05 #4
Thanks! The solution to a problem could often be a stupid detail that have
been overseen. But in this case the field is in the recordsource of the
report.

Sigurd
"bebelino" <a.*@c.d> skrev i melding
news:6p********************************@4ax.com...
On Fri, 3 Oct 2003 15:47:40 +0200, "Sigurd Bruteig"
<s-********@online.no> wrote:

Dim stDocName As String
stDocName = "rptFaktura"
Dim stLinkCriteria As String
stLinkCriteria = "[Invoicedate]= " & Date

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria


Maybe stupid, but are you sure that the name [Invoicedate] is part of
your query behind the report?
--
bebelino

Nov 12 '05 #5
"Sigurd Bruteig" <s-********@online.no> wrote in
news:gL*******************@news4.e.nsc.no:

"Tom van Stiphout" <to*****@no.spam.cox.net> skrev i melding
news:dl********************************@4ax.com...
On Fri, 3 Oct 2003 15:47:40 +0200, "Sigurd Bruteig"
<s-********@online.no> wrote:

Try this:
stLinkCriteria = "[Invoicedate]=#" & Date & "#"


Thank you Tom, but it is still the same error. The date is correct it
seems (when i hold the cursor over the date it is displayed
correctly). [Invoicedate] is a field in a table, present in the
report.


[notices ".no" at end of email address]
You may be being tripped up by the localization of your date format. Try

stLinkCriteria = "[Invoicedate]=#" & format(date,"yyyy-mm-dd") & "#"

--
Ross Presser -- rpresser AT imtek DOT com
"... VB is essentially the modern equivalent of vulgar Latin in 13th Centurary Europe. Understand it, and
you can travel to places you never heard of and still understand some people." -- Alex K. Angelopoulos
Nov 12 '05 #6
> The following code give me an error message (syntax error 3075) and I can't
figure out what is wrong! Any suggestions?

Sigurd

Dim stDocName As String
stDocName = "rptFaktura"
Dim stLinkCriteria As String
stLinkCriteria = "[Invoicedate]= " & Date

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria


Is the field "Invoicedate" a Date/Time data type? If not, you might look for
entries in that field that contain invalid characters.

See http://support.microsoft.com/default...b;en-us;178070.

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #7

"Sigurd Bruteig" <s-********@online.no> skrev i melding
news:66*******************@news4.e.nsc.no...
Hi!
The following code give me an error message (syntax error 3075) and I can't figure out what is wrong! Any suggestions?

Sigurd

Dim stDocName As String
stDocName = "rptFaktura"
Dim stLinkCriteria As String
stLinkCriteria = "[Invoicedate]= " & Date


Thank you all! After hours with trying and failing, I finaly found the right
syntax:
stLinkCriteria = "[Invoicedate] = Date()"
DoCmd.OpenReport stDocName, , , stLinkCriteria

Sigurd
Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris | last post by:
I have tableA, defined as: field1 varchar2(10), field2 varchar2(10), field3 varchar2(10) I have host variables defined as: v1 pic x(10) varying v2 pic x(10) varying
1
by: M Wells | last post by:
Hi All, I have a database that is serving a web site with reasonably high traffiic. We're getting errors at certain points where processes are being locked. In particular, one of our people...
2
by: seigo | last post by:
I use datetime condition in sql-query. For example: select something from sometable where date between '06/15/04 00:00:00' and '06/15/04 23:59:59' and result on two synchronized servers is...
8
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
2
by: Ely | last post by:
Can some one write me the code in Visual Basic for an expretion similar to the Where Condition to open a report? I can't use the Where Condition because it pop up a message of Microsoft database...
4
by: Jane T | last post by:
I appreciate how difficult it is to resolve a problem without all the information but maybe someone has come across a similar problem. I have an 'extract' table which has 1853 rows when I ask for...
3
by: pbassutti | last post by:
Hello, I'm trying to link two tables... one for Employees and the other for Timecards I need to get a list of employees that do not have timecards on an SPECIFIC DATE I tried the follonwing
37
by: Phlip | last post by:
1230987za wrote: Kanze is a classically-trained "unit tester". In some circles "unit" is a QA concept - specifically, if a test fails, you only need to inspect one unit. So "units" are...
10
by: BHTanna | last post by:
I have one stored procedure, which defines where condition based useing Case when...I m storing this Condition in one outpur variable of Store procedure. I would like to now use this condition...
12
by: =?ISO-8859-1?Q?Ren=E9?= | last post by:
Hi, is there a rule of thumb what is better/faster/more performant in SQL Server 2005? a) SELECT * FROM A INNER JOIN B ON B.ID = A.ID AND B.Cond1 = 1 AND B.Cond2 = 2 b) SELECT * FROM A INNER...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...

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.