Search Form (1 Viewer)

scouser

Registered User.
Local time
Today, 08:08
Joined
Nov 25, 2003
Messages
767
Hi. I have a search button on a form (calls a macro).

I have followed: https://www.youtube.com/watch?v=wCPs4aE5I2w to create the search box.

The WHERE condition is:

[OrderID] Like "*" & [Forms]![frmSalesOrders]![txtOrderSearch] &"*"

I have the following issues:
OrderID values exist 1000 to 1008

If user searches 1050 (does not exist) the search opens a blank record generating a new order 1009, 1010 etc.

I would like it to display 'No record matches search' and then go to the last record.

Also if I enter search value 1 order 1000 is displayed. The txtOrderSearch locks up and no further entries/deletions are allowed.

I will provide a sample database shortly.

Can anyone help with this one.
Phil.
 
Last edited:

Minty

AWF VIP
Local time
Today, 08:08
Joined
Jul 26, 2013
Messages
10,371
If the Order ID is unique and a number lose the Like "*"'s and simply put

Code:
[OrderID] = Forms]![frmSalesOrders]![txtOrderSearch]
 

scouser

Registered User.
Local time
Today, 08:08
Joined
Nov 25, 2003
Messages
767
Strange one. I stripped the DB back to include only the form I wished to post about and it does not generate the issue! If I perform the same action in the main DB the issue remains.

I will need to review.
Phil.
 

Minty

AWF VIP
Local time
Today, 08:08
Joined
Jul 26, 2013
Messages
10,371
It might be worth putting the actions into VBA - it is much easier to debug than in a macro.
 

Users who are viewing this thread

Top Bottom