i need to take the house numbers from the address field. if it is a PO Box or the address has a hyphen or letter, i want the field to be blank.
i tried this:
addr: Left([address],InStr([address]," ")-1)
that gave me whatever was put in before the first space. it did include the PO and addresses like 19A.
then I wanted to determine if it was a PO Box
so i determined what the first character was.
A: Left([addr],1)
then i ran a query on that, asking to display [addr] if [A}<="9" And >="1".
So if the address had a PO Box it would show up blank, but that doesn't solve the hyphen and letter problem. can i somehow tell it only to display if the [addr] if it contains only numeric characters? i suppose i could write a function, but i have no idea how to write it.
i tried this:
addr: Left([address],InStr([address]," ")-1)
that gave me whatever was put in before the first space. it did include the PO and addresses like 19A.
then I wanted to determine if it was a PO Box
so i determined what the first character was.
A: Left([addr],1)
then i ran a query on that, asking to display [addr] if [A}<="9" And >="1".
So if the address had a PO Box it would show up blank, but that doesn't solve the hyphen and letter problem. can i somehow tell it only to display if the [addr] if it contains only numeric characters? i suppose i could write a function, but i have no idea how to write it.