Hi all,
As you may have seen in a previous post of mine I am quite new to access and VBA. I am setting up a search database which will be being used by the team I work for at work and need to search through all of the postcodes in the UK as part of our job role to see what delivery Windows are offered for each one.
I currently have it basically set up to search and find the result however when you type in "D" for example it will bring up "BD1 1,BD1 2, etc" rather than "DA1 1, DA1 2, etc" and I know this is due to it bringing up the first result in the list as it works its way down however I need it to look through and if "D" is the first character provided it will bring back all the results with D as the first letter back so it's saving time scrolling through all the results with the specified search criteria in it.
Current code looks something like:
Dim search as string
Dim task as string
If ISNULL (me.txtSearch) OR txtSearch = "" then
MsgBox "No Results Found" vbYESOnly
ELSE
Search = txtSearch.Value
Task = "SELECT FROM * PostcodeT WHERE (postcode LIKE ""*" & Search & "*"")
Me.RecordSource = Task
End If
Thanks in advance for any help given
As you may have seen in a previous post of mine I am quite new to access and VBA. I am setting up a search database which will be being used by the team I work for at work and need to search through all of the postcodes in the UK as part of our job role to see what delivery Windows are offered for each one.
I currently have it basically set up to search and find the result however when you type in "D" for example it will bring up "BD1 1,BD1 2, etc" rather than "DA1 1, DA1 2, etc" and I know this is due to it bringing up the first result in the list as it works its way down however I need it to look through and if "D" is the first character provided it will bring back all the results with D as the first letter back so it's saving time scrolling through all the results with the specified search criteria in it.
Current code looks something like:
Dim search as string
Dim task as string
If ISNULL (me.txtSearch) OR txtSearch = "" then
MsgBox "No Results Found" vbYESOnly
ELSE
Search = txtSearch.Value
Task = "SELECT FROM * PostcodeT WHERE (postcode LIKE ""*" & Search & "*"")
Me.RecordSource = Task
End If
Thanks in advance for any help given