Search box

neilmcmor

Registered User.
Local time
Today, 14:45
Joined
Aug 9, 2007
Messages
70
I have a button on my form which when clicked opens the search box and finds a record. However I am not too impressed with the search box Access throw up. Is there any way for the click to open up a custom designed box?:confused:
 
What don't you like about the one you're currently getting? What are you trying to change about it?
 
Hi

Its the standard windows search/replace box with all the 'match case' etc stuff attached. . All I want is a box with a field to type the search criteria and ok cancel buttons. Perhaps a small form.
 
I would create a Dialog Form and create fields to initiate the search. When Searching allow the short searching but allowing wildcards i.e.

[MyField1] = Forms![MySearch][Field1] & "*"

or VB using With CodeContextObject

"[MyField] like '" & .[Field1] & "*" & "'"

Simon
 
Not sure how to create a dialog form. I have stuck this code on to a button on the form I want the search string to go to. The field I want to search is [Spin]. But its still not working. The box comes up when the button is clicked and when I enter the anything in the box it comes up with "Invalid use of Null". The main form is called Prisoner_Details.

Private Sub cmdFind_Click()
On Error GoTo Err_cmdFind_Click

Dim answer As String
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Prisoner_Details"

answer = InputBox("Enter the Spin Number you wish to search for", "Find on Spin")

stLinkCriteria = "[Spin]= answer

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdFind_Click:
Exit Sub
Err_cmdFind_Click:
MsgBox Err.Description
Resume Exit_cmdFind_Click
End Sub
 

Users who are viewing this thread

Back
Top Bottom