SQL Statement Wildcard

dynamictiger

Registered User.
Local time
Today, 13:11
Joined
Feb 3, 2002
Messages
270
I am writing a qdf as a postcode lookup. I have written a function to sort between po boxes and other addresses, However, Aussie Post have kindly included annotations to the suburbs. This is causing the odd suburb to not be found using a straight match. I thought I would try a wildcard search "like suburb & *", however, my code hangs on this.

SQLOutput "SELECT AusPostCodes.ID, AusPostCodes.Pcode, AusPostCodes.Locality, " & _
"AusPostCodes.State, AusPostCodes.Comments, AusPostCodes.DeliveryOffice, " & _
"AusPostCodes.PresortIndicator, AusPostCodes.ParcelZone, AusPostCodes.BSPnumber, " & _
"AusPostCodes.BSPname, AusPostCodes.Category " & _
"FROM AusPostCodes "
"WHERE (((AusPostCodes.Locality) Like [Forms]![frmNewRecord]![txtsuburb] & ' * ') " & _
"AND ((AusPostCodes.State) Like [Forms]![frmNewRecord]![txtstate] & "*") AND " & _
"((AusPostCodes.Comments) Like "PO" & "*"));, _
qdfTemp

I think from what I can see on MSDN that the wildcard is wrong and perhaps should be %. However, whenever I visit this particular MSDN entry Internet Explorer crashes.

I am using XP by the way.
 

Users who are viewing this thread

Back
Top Bottom