Hi There, Could someone help me with little problem with Access 2003, I have a database with address details and sometimes I need to search on a post code (zip code). The way I have done this is to set a public variable with the post code which is then passed to a query as criteria.
On the after update function of the (search for postcode) field on the form, I change the recordsource to this query and it brings up just the records with that exact postcode.
However, if no such post code exists, then the query still runs, but with no records as the result which means the recordsource is set against this query with no records and consequentially the form just displays as a completely blank screen as there are no records.
My question is, how can I trap this so that if the post code does not exist, the record source is not changed and I can put up a message box saying there are no matches.
I’m really stumped at the moment, any help would be gratefully received, even a better way of performing the task
Many thanks
James
On the after update function of the (search for postcode) field on the form, I change the recordsource to this query and it brings up just the records with that exact postcode.
However, if no such post code exists, then the query still runs, but with no records as the result which means the recordsource is set against this query with no records and consequentially the form just displays as a completely blank screen as there are no records.
My question is, how can I trap this so that if the post code does not exist, the record source is not changed and I can put up a message box saying there are no matches.
I’m really stumped at the moment, any help would be gratefully received, even a better way of performing the task
Many thanks
James