Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why an I getting a "Syntax" error with the where condition?

Posted on 2014-11-26
9
Medium Priority
?
123 Views
Last Modified: 2015-01-31
I have tried may combinations of the code below, but still get syntax error?

BAD CODE:
SS_OpenForm("Human_P_T_frm"), ([Event_Description]=" & "'" & [Event_Description] & "'")

Any help is greatly appreciated.
ERROR-MESSAGE-1.jpg
ERROR-MESSAGE-2.jpg
Works-Fine-1.jpg
0
Comment
Question by:cssc1
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 40467813
AFAICT, ...you can try it something like this:
Docmd.OpenForm "Human_P_T_frm",,,[Event_Description]=" & "'" & [Event_Description] & "'"
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 500 total points
ID: 40467833
Is SS_OpenForm a custom function?  (it would help to see the function declaration).

That said, it looks like your criteria is missing an opening quote, so try this perhaps:


SS_OpenForm  "Human_P_T_frm",  "[Event_Description]=" & "'" & [Event_Description] & "'" 

Open in new window

0
 
LVL 12

Assisted Solution

by:FarWest
FarWest earned 500 total points
ID: 40467838
I learned a good practice (I think) is to use char(34) instead of " when ever it should placed inside another quote
you will always know what " will be inside your string :)
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:cssc1
ID: 40467956
mbizup (SMIB),
   Sorry, but see attached error message with your example.
Error-3.jpg
0
 
LVL 52

Assisted Solution

by:Gustav Brock
Gustav Brock earned 500 total points
ID: 40468441
It should probably read:

SS_OpenForm("Human_P_T_frm", "[Event_Description] = '" & [Event_Description] & "'")

/gustav
0
 

Author Comment

by:cssc1
ID: 40468861
Gustav Brock,
  Please see error.
Thanks and can you think of any other any other options based on what the error says?
ERROR---3.jpg
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 40468873
Without knowing the internals of your custom SS_OpenForm function I'm afraid we can't solve this.

/gustav
0
 
LVL 61

Expert Comment

by:mbizup
ID: 40468938
Exactly.   We're taking shots in the dark here.

Jeff Coachman's use of the built in OpenForm should do the trick, however, with the assumption that your custom function is simply opening the form and not doing anything else.
0
 

Author Comment

by:cssc1
ID: 40505346
Thanks
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question