VB Click Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used VB a few years ago VB3 !! I have written a database (with help from
here) and wish to :-
Command Button - Click Event - Show user a text box where they enter text -
this opens a From - searches the database for instances of text entered - and
displays relevant records.
Any usueful books on VB code for Access 2003?
Any useful tips on how to do this would be much appreciated !

Al
 
Al,

Sample code assuming you want to open form MyForm, whose recordsource
contains field MyField, which contains string entered by user:

Dim searchstr As String
searchstr = InputBox("Please eneter string to search for")
DoCmd.OpenForm "MyForm", , , "MyField Like '*" & searchstr & "*'"

HTH,
Nikos
 
Back
Top