My query keeps deleting itself?..

PMFJI,

Don't you mean to test strCustomer?

You could use
Code:
strCustomer = NZ(Me.xKlientSelection,"AllClients")
 
PMFJI,

Don't you mean to test strCustomer?

You could use
Code:
strCustomer = NZ(Me.xKlientSelection,"AllClients")
Right, so that worked flawlessly right off the bat.
I still got plenty to learn.
Thank you, i appreciate this!
 
Code:
If strPath Is Null Then
strPath = "AllClients"
End If
Else

That sequence should never compile. The "ELSE" is outside of the IF/END IF block. If you have an "empty' ELSE you can just omit it, in which case the "ELSE" is "do nothing."
 
Last edited:
I think the structure of your WHERE-clausule is wrong. You put it like this:

Code:
... WHERE table.Field1 = FormFieldProperty1 OR FormFieldProperty1 IS NULL

Of course there's an error on your destination field, because you define in the first half of the WHERE-clausule the FormFieldProperty1 as a value of which table.Field1 must compare with, and in the second half of the WHERE-clausule you use this field as a field to compare with IS NULL.
What do you want to do?
  1. do select the Field1 with a form property value: then use the first half of the WHERE-clausule. You create a subset of the original set.
  2. the second half of the WHERE-clausule: I don't know what's the meaning of this? You don't refer to the original table as a selection criterium. You refer to a form value whether it's NULL or NOT NULL. Here you don't create anything. You can resolve this to put the result of the query with the first clausule in an IF ELSE ENDIF-procedure, like this:
Code:
IF FormFieldProperty1 IS NULL Then
    do something
Else
    do something else
End
 
I think the structure of your WHERE-clausule is wrong. You put it like this:

Code:
... WHERE table.Field1 = FormFieldProperty1 OR FormFieldProperty1 IS NULL
This is actually a common way of returning all the records if nothing is selected in the form control.
It relies on equating to one or the other expression.
 
I have also faced problems with the contents of query string disappearing from a stored query when run. All I could to do was to store the SQL from each query and fix it when is disappeared.
 
I have also faced problems with the contents of query string disappearing from a stored query when run. All I could to do was to store the SQL from each query and fix it when is disappeared.
oof, that's unfortunate. really hope that won't be the case in this instance!
thank you for the heads up though!
 

Users who are viewing this thread

Back
Top Bottom