run time error 3075

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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...
 
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...
 
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
 
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...
 
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...
 
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...
 
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...
 
Back
Top