Solved

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

Posted on 2014-11-26
9
114 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 125 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 125 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 125 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
 

Author Comment

by:cssc1
ID: 40467956
mbizup (SMIB),
   Sorry, but see attached error message with your example.
Error-3.jpg
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 125 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 49

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now