run time error 3075

B

BLTibbs

Why am I getting a syntax - missing operator - error with this code? I am
trying to open a report based on the scoutpaiddate field.

Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me.[ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End Sub

Please help...
 
B

BLTibbs

I am getting the same error with this code:

Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me![ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere



Ron Hinds said:
Try Me![ScoutPaidDate]

BLTibbs said:
Why am I getting a syntax - missing operator - error with this code? I am
trying to open a report based on the scoutpaiddate field.

Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me.[ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End Sub

Please help...
 
J

John Spencer

Two possibilities that I see.

1) Can Me.ScoutPaidDate be blank (null)?
2) Is ScoutPaidDate a Date field?

Assuming both answers are yes. Then you need to test for the blank or null value
and you need to delimit the date with # signs in stWhere.


Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String


IF IsNull(Me.ScoutPaidDate) then
MsgBox "Date is required in Paid Date field."
ELSE
stWhere = "[scoutpaiddate] = #" & Me.[ScoutPaidDate] & "#"
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End If

End Sub
 
B

BLTibbs

I don't know what to say! It is guys like you in this helpgroup that make me
look like I know what I am doing. Thanks so much!

John Spencer said:
Two possibilities that I see.

1) Can Me.ScoutPaidDate be blank (null)?
2) Is ScoutPaidDate a Date field?

Assuming both answers are yes. Then you need to test for the blank or null value
and you need to delimit the date with # signs in stWhere.


Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String


IF IsNull(Me.ScoutPaidDate) then
MsgBox "Date is required in Paid Date field."
ELSE
stWhere = "[scoutpaiddate] = #" & Me.[ScoutPaidDate] & "#"
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End If

End Sub
Why am I getting a syntax - missing operator - error with this code? I am
trying to open a report based on the scoutpaiddate field.

Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me.[ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End Sub

Please help...
 
J

John Spencer

I assume that to mean your problem is solved.

By the way, thanks for posting back. Feedback lets us (volunteers) know how
things worked and positive feedback makes it worth my (our) while to continue helping.
I don't know what to say! It is guys like you in this helpgroup that make me
look like I know what I am doing. Thanks so much!

John Spencer said:
Two possibilities that I see.

1) Can Me.ScoutPaidDate be blank (null)?
2) Is ScoutPaidDate a Date field?

Assuming both answers are yes. Then you need to test for the blank or null value
and you need to delimit the date with # signs in stWhere.


Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String


IF IsNull(Me.ScoutPaidDate) then
MsgBox "Date is required in Paid Date field."
ELSE
stWhere = "[scoutpaiddate] = #" & Me.[ScoutPaidDate] & "#"
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End If

End Sub
Why am I getting a syntax - missing operator - error with this code? I am
trying to open a report based on the scoutpaiddate field.

Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me.[ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End Sub

Please help...
 
B

BLTibbs

Why do you guys do this volunteer by the way? Are you compensated with
software or something like that?

John Spencer said:
I assume that to mean your problem is solved.

By the way, thanks for posting back. Feedback lets us (volunteers) know how
things worked and positive feedback makes it worth my (our) while to continue helping.
I don't know what to say! It is guys like you in this helpgroup that make me
look like I know what I am doing. Thanks so much!

John Spencer said:
Two possibilities that I see.

1) Can Me.ScoutPaidDate be blank (null)?
2) Is ScoutPaidDate a Date field?

Assuming both answers are yes. Then you need to test for the blank or null value
and you need to delimit the date with # signs in stWhere.


Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String


IF IsNull(Me.ScoutPaidDate) then
MsgBox "Date is required in Paid Date field."
ELSE
stWhere = "[scoutpaiddate] = #" & Me.[ScoutPaidDate] & "#"
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End If

End Sub

BLTibbs wrote:

Why am I getting a syntax - missing operator - error with this code? I am
trying to open a report based on the scoutpaiddate field.

Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me.[ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End Sub

Please help...
 
J

John Spencer

Hard to say reasons for everyone. Pick as many as you like.

== Pay back to the community
== Chance to show off
== Recognition by Microsoft as MVP
== Recognition by peers
== Charity
== Altrusim
== Good feelings at helping others
== ...


Why do you guys do this volunteer by the way? Are you compensated with
software or something like that?

John Spencer said:
I assume that to mean your problem is solved.

By the way, thanks for posting back. Feedback lets us (volunteers) know how
things worked and positive feedback makes it worth my (our) while to continue helping.
I don't know what to say! It is guys like you in this helpgroup that make me
look like I know what I am doing. Thanks so much!

:

Two possibilities that I see.

1) Can Me.ScoutPaidDate be blank (null)?
2) Is ScoutPaidDate a Date field?

Assuming both answers are yes. Then you need to test for the blank or null value
and you need to delimit the date with # signs in stWhere.


Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String


IF IsNull(Me.ScoutPaidDate) then
MsgBox "Date is required in Paid Date field."
ELSE
stWhere = "[scoutpaiddate] = #" & Me.[ScoutPaidDate] & "#"
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End If

End Sub

BLTibbs wrote:

Why am I getting a syntax - missing operator - error with this code? I am
trying to open a report based on the scoutpaiddate field.

Private Sub Command10_Click()
Dim stScoutReport As String
Dim stWhere As String
stWhere = "[scoutpaiddate] = " & Me.[ScoutPaidDate]
stScoutReport = "ScoutStatementRpt"
DoCmd.OpenReport stScoutReport, acViewPreview, , stWhere
End Sub

Please help...
 
B

BLTibbs

I was hoping that was the answer - thank you and thanks to all the others
that do it!
 

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