what is "missing ).], or item in query expression '([St'."

darbid

Registered User.
Local time
Tomorrow, 00:08
Joined
Jun 26, 2008
Messages
1,428
what is "missing ).], or item in query expression '([St'."[Solved]

Upon opening a form i get

missing ).], or item in query expression '([St'.

I have searched for ([ST and even quoted them out but I still get this error.

Where is the problem?
 
Last edited:
Whats the VBA code in the background?

Lots of stuff - I would think too much to put on the forum.

Mainly it is a form with some text and comboboxes which are bound and unbound depending on whether I am searching for something or make a new record.

at the time I got the message I was working on this below.....

I was attempting to add a variable of strgreaterthan so that I could change the sign from a ">" to a "<".

This also has a ([St in it so I quoted it out

Code:
'strgreaterthan = ">"
 
'Date Field for the start
'If Me.Start.Value > "01/01/1900" Then   'Less than the next day.
'       strstartdate = Me.Start.Value
'        strWhere = strWhere & "([Start] """&strgreaterthan&""" " & Format(Me.Start.Value + 1, conJetDate) & ") AND "
'    End If

Which was not working
 
I just deleted all VBA for the form and still get the same message.
 
I just deleted all VBA for the form and still get the same message.

Go into every query, table, form etc that the form gets its information from see if the same error comes up.
 
Go into every query, table, form etc that the form gets its information from see if the same error comes up.

"go into" means? I go to the query and click on it and see if I get an error.

I go to the tables and click on them and see if they open ok.
 
I would sat, generally speaking dont use "value" when referring to controls. its superfluous and I think its sometimes incorrect

now, assuming start is a date field then this line will fail

'If Me.Start.Value > "01/01/1900" Then

to compare dates you need to use the # character

so instead try

if start > #01/01/1900# then

-------
The easiest way to debug all this, is to put a breakpoint by the first line in the forms code (open event, or load event), and step through the code with F8.
 
I would sat, generally speaking dont use "value" when referring to controls. its superfluous and I think its sometimes incorrect

now, assuming start is a date field then this line will fail

'If Me.Start.Value > "01/01/1900" Then

to compare dates you need to use the # character

so instead try

if start > #01/01/1900# then


on this issue I am sorry I did not give you the full picture. conJetDate is declared above which puts the "#".

Code:
Const conJetDate = "\#mm\/dd\/yyyy\#"

In fact it works except I do not know how to replace the < with a variable so that i can choose > or < without writing the code twice.
 
Last edited:
Ok following stormrider -

I have checked all macros/forms/tables/reports/queries and they all work.
In I can run the code fully as long as I do not call this form.

So I deleted all VBA behind this form. :mad:
I deleted ALL controls on this form. :mad:

I made a new DB and imported this form ONLY :mad:
I deleted all VBA code and controls :mad:

Does anyone know what this is?
 
I am an idiot. If you delete all those things there is only one place it can be.......In the properties of the form itself.

In the Data section of the form I have found.....your guessed it [[St :eek:
 
oh and GTH my simple syntax issue is solved like this

Code:
strWhere = strWhere & "([Start] " & strgreaterthan & " " & Format(Me.Start + 1, conJetDate) & ") AND "
 
the good thing is, is that having seen it once, it will ring a bell next time!
 

Users who are viewing this thread

Back
Top Bottom