Access 2007 PARAMETER

A

Alexey

Hi

Is there an issue with PARAMETER in Access 2007. i have an application
which runs perfectly well in 2002 / 2003 but when we run a function in
Access 2007, we get an '3139 Syntax error in PARAMETER clause' message?

Thanks
A
 
K

KARL DEWEY

when we run a function in Access 2007, we get an '3139 Syntax error in
PARAMETER clause' message?
You did not say what function is giving you the errors.
How are you formatting the PARAMETER? Post your SQL.
 
A

alex

If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

'send copy of feedback to tutor by email
Dim TutorEmail As String
Dim FeedBackMail As String
Dim msg As String
Dim subj As String
Dim r As Long
Dim EmailToStudent As Boolean

If Nz(Me![Primary Email], "") <> "" And Me![Feedback Method] = "Email"
Then
EmailToStudent = True
Else
EmailToStudent = False
End If

If EmailToStudent Then
msg = "Would you like to email the student"
msg = msg & vbNewLine
msg = msg & "or print preview the report?"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Yes to email them"
msg = msg & vbNewLine
msg = msg & "No to print preview"
msg = msg & vbNewLine
msg = msg & "or cancel"
r = MsgBox(msg, vbYesNoCancel + vbQuestion, "Email to Student")
Select Case r
Case vbYes
EmailToStudent = True
Case vbNo
EmailToStudent = False
Case vbCancel
GoTo btnFeedbackScores_Click_exit
End Select
End If

If EmailToStudent Then
msg = "Hi " & Nz(Me![Nickname], Me![Forename]) & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached the marks & feedback for module "
& Me![cboModule] & " which you submitted recently."
msg = msg & vbNewLine & vbNewLine
msg = msg & "This message has been sent from the Administration
offices. If you have and comments or wish to discuss the feedback please
contact your tutor, and not the office. Your tutor will have been sent a
copy of this message. "
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "The attached file is in Microsoft Snapshot format, and if
you have Microsoft Access installed on your computer you should be able to
read the file. However, if it is not installed, or you are having any
difficulty in opening or reading the file, please go to the Student
Resources Area of the xxx web site where you will be able to download the
snapshop viewer free of charge."
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "Administration Team"
subj = "Feedback for Module " & Me![cboModule]
DoCmd.SendObject acSendReport, "rptStudentMarkingFeedbackLetter",
"Snapshot Format (*.snp)", Me![Primary Email], , , subj, msg, True
Else
DoCmd.OpenReport "rptStudentMarkingFeedbackLetter", acViewPreview, , ,
acDialog
End If

Me![StuModFeedbackSentOn] = Now()

TutorEmail = Nz(DLookup("", "tblTutors", "[TutorID] = """ &
Me![Student Tutor] & """"), "")
FeedBackMail = Me![cboModule] & "[email protected]

If TutorEmail = "" Then
msg = "I can't send a copy to the tutor" & vbNewLine
msg = msg & Me![Student Tutor] & " has no email address on file."
MsgBox msg, vbInformation + vbOKOnly, "Tutor Email Cancelled"
GoTo btnFeedbackScores_Click_exit
Else
msg = "Hi " & DLookup("[Forename]", "tblTutors", "[TutorID] = """ &
Me![Student Tutor] & """") & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached a copy of the moderated feedback
for:"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Student: " & Me![cboStudent].Column(1)
msg = msg & vbNewLine
msg = msg & "Module: " & Me![cboModule]
subj = "Moderated Feedback: " & Me![cboModule] & " - " &
Me![cboStudent].Column(1)
DoCmd.SendObject acSendReport,
"rptStudentAssignmentFeedbackDetailsCCtoTutor", "Snapshot Format (*.snp)",
TutorEmail, FeedBackMail, , subj, msg, True
End If

btnFeedbackScores_Click_exit:
On Error Resume Next
Exit Sub

btnFeedbackScores_Click_error:
Select Case Err
Case 2501 'action cancelled
Resume Next
Case Else
MsgBox Err & " - " & Error$, vbCritical + vbOKOnly, "Error in
btnFeedbackScores_Click"
Resume btnFeedbackScores_Click_exit
End Select
End Sub
 
K

KARL DEWEY

Someone else will need to help you with this one.
--
KARL DEWEY
Build a little - Test a little


alex said:
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

'send copy of feedback to tutor by email
Dim TutorEmail As String
Dim FeedBackMail As String
Dim msg As String
Dim subj As String
Dim r As Long
Dim EmailToStudent As Boolean

If Nz(Me![Primary Email], "") <> "" And Me![Feedback Method] = "Email"
Then
EmailToStudent = True
Else
EmailToStudent = False
End If

If EmailToStudent Then
msg = "Would you like to email the student"
msg = msg & vbNewLine
msg = msg & "or print preview the report?"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Yes to email them"
msg = msg & vbNewLine
msg = msg & "No to print preview"
msg = msg & vbNewLine
msg = msg & "or cancel"
r = MsgBox(msg, vbYesNoCancel + vbQuestion, "Email to Student")
Select Case r
Case vbYes
EmailToStudent = True
Case vbNo
EmailToStudent = False
Case vbCancel
GoTo btnFeedbackScores_Click_exit
End Select
End If

If EmailToStudent Then
msg = "Hi " & Nz(Me![Nickname], Me![Forename]) & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached the marks & feedback for module "
& Me![cboModule] & " which you submitted recently."
msg = msg & vbNewLine & vbNewLine
msg = msg & "This message has been sent from the Administration
offices. If you have and comments or wish to discuss the feedback please
contact your tutor, and not the office. Your tutor will have been sent a
copy of this message. "
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "The attached file is in Microsoft Snapshot format, and if
you have Microsoft Access installed on your computer you should be able to
read the file. However, if it is not installed, or you are having any
difficulty in opening or reading the file, please go to the Student
Resources Area of the xxx web site where you will be able to download the
snapshop viewer free of charge."
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "Administration Team"
subj = "Feedback for Module " & Me![cboModule]
DoCmd.SendObject acSendReport, "rptStudentMarkingFeedbackLetter",
"Snapshot Format (*.snp)", Me![Primary Email], , , subj, msg, True
Else
DoCmd.OpenReport "rptStudentMarkingFeedbackLetter", acViewPreview, , ,
acDialog
End If

Me![StuModFeedbackSentOn] = Now()

TutorEmail = Nz(DLookup("", "tblTutors", "[TutorID] = """ &
Me![Student Tutor] & """"), "")
FeedBackMail = Me![cboModule] & "[email protected]

If TutorEmail = "" Then
msg = "I can't send a copy to the tutor" & vbNewLine
msg = msg & Me![Student Tutor] & " has no email address on file."
MsgBox msg, vbInformation + vbOKOnly, "Tutor Email Cancelled"
GoTo btnFeedbackScores_Click_exit
Else
msg = "Hi " & DLookup("[Forename]", "tblTutors", "[TutorID] = """ &
Me![Student Tutor] & """") & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached a copy of the moderated feedback
for:"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Student: " & Me![cboStudent].Column(1)
msg = msg & vbNewLine
msg = msg & "Module: " & Me![cboModule]
subj = "Moderated Feedback: " & Me![cboModule] & " - " &
Me![cboStudent].Column(1)
DoCmd.SendObject acSendReport,
"rptStudentAssignmentFeedbackDetailsCCtoTutor", "Snapshot Format (*.snp)",
TutorEmail, FeedBackMail, , subj, msg, True
End If

btnFeedbackScores_Click_exit:
On Error Resume Next
Exit Sub

btnFeedbackScores_Click_error:
Select Case Err
Case 2501 'action cancelled
Resume Next
Case Else
MsgBox Err & " - " & Error$, vbCritical + vbOKOnly, "Error in
btnFeedbackScores_Click"
Resume btnFeedbackScores_Click_exit
End Select
End Sub
 
A

Alexey

Thanks for looking anyway

A

KARL DEWEY said:
Someone else will need to help you with this one.
--
KARL DEWEY
Build a little - Test a little


alex said:
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

'send copy of feedback to tutor by email
Dim TutorEmail As String
Dim FeedBackMail As String
Dim msg As String
Dim subj As String
Dim r As Long
Dim EmailToStudent As Boolean

If Nz(Me![Primary Email], "") <> "" And Me![Feedback Method] = "Email"
Then
EmailToStudent = True
Else
EmailToStudent = False
End If

If EmailToStudent Then
msg = "Would you like to email the student"
msg = msg & vbNewLine
msg = msg & "or print preview the report?"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Yes to email them"
msg = msg & vbNewLine
msg = msg & "No to print preview"
msg = msg & vbNewLine
msg = msg & "or cancel"
r = MsgBox(msg, vbYesNoCancel + vbQuestion, "Email to Student")
Select Case r
Case vbYes
EmailToStudent = True
Case vbNo
EmailToStudent = False
Case vbCancel
GoTo btnFeedbackScores_Click_exit
End Select
End If

If EmailToStudent Then
msg = "Hi " & Nz(Me![Nickname], Me![Forename]) & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached the marks & feedback for module
"
& Me![cboModule] & " which you submitted recently."
msg = msg & vbNewLine & vbNewLine
msg = msg & "This message has been sent from the Administration
offices. If you have and comments or wish to discuss the feedback please
contact your tutor, and not the office. Your tutor will have been sent a
copy of this message. "
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "The attached file is in Microsoft Snapshot format, and
if
you have Microsoft Access installed on your computer you should be able
to
read the file. However, if it is not installed, or you are having any
difficulty in opening or reading the file, please go to the Student
Resources Area of the xxx web site where you will be able to download
the
snapshop viewer free of charge."
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "Administration Team"
subj = "Feedback for Module " & Me![cboModule]
DoCmd.SendObject acSendReport, "rptStudentMarkingFeedbackLetter",
"Snapshot Format (*.snp)", Me![Primary Email], , , subj, msg, True
Else
DoCmd.OpenReport "rptStudentMarkingFeedbackLetter", acViewPreview,
, ,
acDialog
End If

Me![StuModFeedbackSentOn] = Now()

TutorEmail = Nz(DLookup("", "tblTutors", "[TutorID] = """ &
Me![Student Tutor] & """"), "")
FeedBackMail = Me![cboModule] & "[email protected]

If TutorEmail = "" Then
msg = "I can't send a copy to the tutor" & vbNewLine
msg = msg & Me![Student Tutor] & " has no email address on file."
MsgBox msg, vbInformation + vbOKOnly, "Tutor Email Cancelled"
GoTo btnFeedbackScores_Click_exit
Else
msg = "Hi " & DLookup("[Forename]", "tblTutors", "[TutorID] = """ &
Me![Student Tutor] & """") & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached a copy of the moderated
feedback
for:"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Student: " & Me![cboStudent].Column(1)
msg = msg & vbNewLine
msg = msg & "Module: " & Me![cboModule]
subj = "Moderated Feedback: " & Me![cboModule] & " - " &
Me![cboStudent].Column(1)
DoCmd.SendObject acSendReport,
"rptStudentAssignmentFeedbackDetailsCCtoTutor", "Snapshot Format
(*.snp)",
TutorEmail, FeedBackMail, , subj, msg, True
End If

btnFeedbackScores_Click_exit:
On Error Resume Next
Exit Sub

btnFeedbackScores_Click_error:
Select Case Err
Case 2501 'action cancelled
Resume Next
Case Else
MsgBox Err & " - " & Error$, vbCritical + vbOKOnly, "Error in
btnFeedbackScores_Click"
Resume btnFeedbackScores_Click_exit
End Select
End Sub



[QUOTE="KARL DEWEY"]
when we run a function in Access 2007, we get an '3139 Syntax error in
PARAMETER clause' message?
You did not say what function is giving you the errors.
How are you formatting the PARAMETER? Post your SQL.

--
KARL DEWEY
Build a little - Test a little


:

Hi

Is there an issue with PARAMETER in Access 2007. i have an
application
which runs perfectly well in 2002 / 2003 but when we run a function in
Access 2007, we get an '3139 Syntax error in PARAMETER clause'
message?

Thanks
A
[/QUOTE]
[/QUOTE][/QUOTE]
 
Top