Validation Rule?

G

Guest

I have a form that uses a query to filter info. I would like to find the code
for using a null value. I'm thinking it might be set up through a validation
rule or event procedure for my execute button.

ex. On a form I have a text box that is "House#" and another that is
"Street" I can enter in the info for instance "123" , "Sesame Street" and it
shows me every record for that address. I would like to set something up
where if I don't enter in a "House#" it will show me every record on Sesame
Street. Any suggestions?

Thanks
 
G

Guest

The SQL is.....

SELECT Section8.[House Number], Section8.Street
FROM Section8
WHERE (((Section8.[House Number])=[Forms]![Street Find]![House#] And
(Section8.[House Number])=[Forms]![Street Find]![House#]) AND
((Section8.Street)=[Forms]![Street Find]![Street] And
(Section8.Street)=[Forms]![Street Find]![Street]));
 
G

Guest

Try this --
SELECT Section8.[House Number], Section8.Street
FROM Section8
WHERE (((Section8.[House Number])=[Forms]![Street Find]![House#]) AND
((Section8.Street)=[Forms]![Street Find]![Street])) OR
(((Section8.Street)=[Forms]![Street Find]![Street]) AND (([Forms]![Street
Find]![House#]) Is Null));


Code Agent said:
The SQL is.....

SELECT Section8.[House Number], Section8.Street
FROM Section8
WHERE (((Section8.[House Number])=[Forms]![Street Find]![House#] And
(Section8.[House Number])=[Forms]![Street Find]![House#]) AND
((Section8.Street)=[Forms]![Street Find]![Street] And
(Section8.Street)=[Forms]![Street Find]![Street]));


KARL DEWEY said:
Post your SQL statement for the query.
 
G

Guest

Thanks for your help!
KARL DEWEY said:
Try this --
SELECT Section8.[House Number], Section8.Street
FROM Section8
WHERE (((Section8.[House Number])=[Forms]![Street Find]![House#]) AND
((Section8.Street)=[Forms]![Street Find]![Street])) OR
(((Section8.Street)=[Forms]![Street Find]![Street]) AND (([Forms]![Street
Find]![House#]) Is Null));


Code Agent said:
The SQL is.....

SELECT Section8.[House Number], Section8.Street
FROM Section8
WHERE (((Section8.[House Number])=[Forms]![Street Find]![House#] And
(Section8.[House Number])=[Forms]![Street Find]![House#]) AND
((Section8.Street)=[Forms]![Street Find]![Street] And
(Section8.Street)=[Forms]![Street Find]![Street]));


KARL DEWEY said:
Post your SQL statement for the query.

:

I have a form that uses a query to filter info. I would like to find the code
for using a null value. I'm thinking it might be set up through a validation
rule or event procedure for my execute button.

ex. On a form I have a text box that is "House#" and another that is
"Street" I can enter in the info for instance "123" , "Sesame Street" and it
shows me every record for that address. I would like to set something up
where if I don't enter in a "House#" it will show me every record on Sesame
Street. Any suggestions?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top