My query keeps deleting itself?.. (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 10:17
Joined
Sep 21, 2011
Messages
14,301
PMFJI,

Don't you mean to test strCustomer?

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

mamradzelvy

Member
Local time
Today, 11:17
Joined
Apr 14, 2020
Messages
145
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!
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:17
Joined
Feb 28, 2001
Messages
27,186
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:

so10070

Registered User.
Local time
Today, 11:17
Joined
Aug 18, 2016
Messages
51
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
 

Minty

AWF VIP
Local time
Today, 10:17
Joined
Jul 26, 2013
Messages
10,371
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.
 

RogerCooper

Registered User.
Local time
Today, 02:17
Joined
Jul 30, 2014
Messages
286
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.
 

mamradzelvy

Member
Local time
Today, 11:17
Joined
Apr 14, 2020
Messages
145
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

Top Bottom