HELP DATE MISMATCH

D

dan.cawthorne

With On My Main Form a I Have a Date Field "RecievedDate" Set to a
Date Type.

The Form is Based on a Query Search,

When I'm Trying to do is Print the Filtered Results on my Current
Reports

So On The Onclick Event of a Button I Used The Following Code

Private Sub PrintAll_Click()

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & " ' "

End Sub

And I Got a Mismatch Error So Then I Change a Code To the Following

Private Sub PrintAll_Click()

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & "#"

End Sub

And Now I Get an Run Time Error 3075

Syntax Error in String In Query Expression '([Recieved Date] =
'05/07/2007#)'

Am I Missing Something?
 
M

Maurice

You are missing a pound sign in front of your fieldname:

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= " &"#" & [Received Date] & "#"

--
Maurice Ausum


With On My Main Form a I Have a Date Field "RecievedDate" Set to a
Date Type.

The Form is Based on a Query Search,

When I'm Trying to do is Print the Filtered Results on my Current
Reports

So On The Onclick Event of a Button I Used The Following Code

Private Sub PrintAll_Click()

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & " ' "

End Sub

And I Got a Mismatch Error So Then I Change a Code To the Following

Private Sub PrintAll_Click()

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & "#"

End Sub

And Now I Get an Run Time Error 3075

Syntax Error in String In Query Expression '([Recieved Date] =
'05/07/2007#)'

Am I Missing Something?
 
D

dan.cawthorne

You are missing a pound sign in front of your fieldname:

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= " &"#" & [Received Date] & "#"

--
Maurice Ausum

With On My Main Form a I Have a Date Field "RecievedDate" Set to a
Date Type.
The Form is Based on a Query Search,
When I'm Trying to do is Print the Filtered Results on my Current
Reports
So On The Onclick Event of a Button I Used The Following Code
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & " ' "
And I Got a Mismatch Error So Then I Change a Code To the Following
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & "#"
And Now I Get an Run Time Error 3075
Syntax Error in String In Query Expression '([Recieved Date] =
'05/07/2007#)'
Am I Missing Something?

Thanks for getting back intouch, I Tried coping that code in, and i
get a complie error

What do you mean pound Sign This One £
 
M

Maurice

Yes I meant this character #. Place it in front of the equalsign:

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]

= #" & [Received Date] & "#"

hth

--
Maurice Ausum


You are missing a pound sign in front of your fieldname:

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= " &"#" & [Received Date] & "#"

--
Maurice Ausum

With On My Main Form a I Have a Date Field "RecievedDate" Set to a
Date Type.
The Form is Based on a Query Search,
When I'm Trying to do is Print the Filtered Results on my Current
Reports
So On The Onclick Event of a Button I Used The Following Code
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & " ' "
And I Got a Mismatch Error So Then I Change a Code To the Following
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & "#"
And Now I Get an Run Time Error 3075
Syntax Error in String In Query Expression '([Recieved Date] =
'05/07/2007#)'
Am I Missing Something?

Thanks for getting back intouch, I Tried coping that code in, and i
get a complie error

What do you mean pound Sign This One #
 
D

dan.cawthorne

Yes I meant this character #. Place it in front of the equalsign:

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]

= #" & [Received Date] & "#"

hth

--
Maurice Ausum

You are missing a pound sign in front of your fieldname:
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= " &"#" & [Received Date] & "#"
--
Maurice Ausum
:
With On My Main Form a I Have a Date Field "RecievedDate" Set to a
Date Type.
The Form is Based on a Query Search,
When I'm Trying to do is Print the Filtered Results on my Current
Reports
So On The Onclick Event of a Button I Used The Following Code
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & " ' "
End Sub
And I Got a Mismatch Error So Then I Change a Code To the Following
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & "#"
End Sub
And Now I Get an Run Time Error 3075
Syntax Error in String In Query Expression '([Recieved Date] =
'05/07/2007#)'
Am I Missing Something?
Thanks for getting back intouch, I Tried coping that code in, and i
get a complie error
What do you mean pound Sign This One #

Still Straching me Head, That Wasnt Working Either, Keep Getting
Compile Error,

So The I Tried The Following

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]"

Worked a Treat,

The Tried a the same on another query this time for the field
[Submitted Date]

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Submitted
Date]


But When I Open the Report i get the Parameter Box With Submitted Date
for me to enter
as if the field don't exist in the form or query,

But it Does

Ive Been and Double Checked the Text Box Name on the Query and Form?

Im Confused, is There another way round apart from creating a Unique
Report and Linking each Field Back To the Report (Too Long Winded)
 
D

dan.cawthorne

Yes I meant this character #. Place it in front of the equalsign:
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= #" & [Received Date] & "#"
You are missing a pound sign in front of your fieldname:
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= " &"#" & [Received Date] & "#"
--
Maurice Ausum
:
With On My Main Form a I Have a Date Field "RecievedDate" Set to a
Date Type.
The Form is Based on a Query Search,
When I'm Trying to do is Print the Filtered Results on my Current
Reports
So On The Onclick Event of a Button I Used The Following Code
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & " ' "
End Sub
And I Got a Mismatch Error So Then I Change a Code To the Following
Private Sub PrintAll_Click()
DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]
= '" & [Received Date] & "#"
End Sub
And Now I Get an Run Time Error 3075
Syntax Error in String In Query Expression '([Recieved Date] =
'05/07/2007#)'
Am I Missing Something?
Thanks for getting back intouch, I Tried coping that code in, and i
get a complie error
What do you mean pound Sign This One #

Still Straching me Head, That Wasnt Working Either, Keep Getting
Compile Error,

So The I Tried The Following

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Received Date]"

Worked a Treat,

The Tried a the same on another query this time for the field
[Submitted Date]

DoCmd.OpenReport "Project_Summary", acViewPreview, , "[Submitted
Date]

But When I Open the Report i get the Parameter Box With Submitted Date
for me to enter
as if the field don't exist in the form or query,

But it Does

Ive Been and Double Checked the Text Box Name on the Query and Form?

Im Confused, is There another way round apart from creating a Unique
Report and Linking each Field Back To the Report (Too Long Winded)

Sorry about the Last Post, I Did Miss the [Submitted Date] Field from
my query
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top