Query to check records for matches to form text box

Redfang87

New member
Local time
Today, 23:16
Joined
May 31, 2017
Messages
6
Pretty new to access, Im trying to create a query that shows all the results that are like a forms input -

The premise is I have a form for raising inspections - on submitting it checks the input address for possible existing records of inspections to that property - if none it inputs a new record - if found a new form is opened where a user checks the discovered properties and selects one if its a match to there's

To do this I thought it best to do a Dcount of a query's results - this way I can use that querys results also for the next forms displaying of possible matches.
The issue im having is the query referencing the forms text boxes im getting a "syntax error in From clause" highlighting the !

SELECT Property.PROP_ID, Property.Number, Property.Street, Property.Area, Property.Postcode
FROM Property LEFT JOIN [Form]![Raise] ON Property.[Number] + Property.[Postcode] = [Form]![Raise]![Add_Number].[text] + [Form]![Raise]![Add_Postcode].[text]
WHERE ([Form]![Raise]![Add_Postcode].[text]) OR ([Form]![Raise]![Add_Number].[text]) Is NOT Null;


I originally had it working on the record being submitted into a temp table - Ive since removed that table due to later steps in what im creating so I want to query the forms text before saving the record into the DB, if anyone can help me or tell me I shouldn't be doing it this way.

Thank you
 
Don't use: .text

The control knows you want the value in it.
You cannot test for null as a group.
Test each control for null.
 
Realised I had got myself tangled with this all I really need is something like this:


SELECT Property.[PROP_ID], Property.[Number], Property.[Street], Property.[Area], Property.[Postcode]
FROM Property
Where Property.[Number] + Property.[Postcode] like [Forms]![Raise]![Add_Num] + [Forms]![Raise]![Add_Postcode]
;
 

Users who are viewing this thread

Back
Top Bottom