Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search records from a form

Status
Not open for further replies.

rob9740

Technical User
Nov 21, 2001
30
IE
Hi all,
Could anyone give me a hand here. I have a form that has an unbound textbox to enter search criteria for a table. I'm using the code below to search the table and open an another form to view the details and it brings up a blank record if the criteria isn't found.
Is it possible to bring up a yes\no dialog box asking the user do they want to enter details on the criteria that wasn't found??

Function FindMacro() As Boolean
On Error GoTo FindMacro_Err

With CodeContextObject
DoCmd.GoToControl "Ticket Number"
DoCmd.OpenForm "Test", acNormal, "", "", , acNormal
DoCmd.FindRecord .[Ticket Number], acEntire, False, , True, acCurrent, True
End With

FindMacro_Exit:
Exit Function

FindMacro_Err:
MsgBox Error$
Resume FindMacro_Exit

End Function

Any help on this would be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top