Hello,
I am trying to add a button to a form that will enable a user to type the data they want in a text box and display only those records with the matching data in the specific field. Then by pushing a command button, only these records with the specific data typed in the text box will be printed.
The article below is exactly what I want, but instead of printing reports I want to print forms.
http://blogs.techrepublic.com.com/msoffice/?p=747
Here is the code provided in the article that I need to transform to match my database:
Dim ReportName
ReportName = "Employees1"
DoCmd.OpenReport _
ReportName:=ReportName, _ view:=acViewPreview, _ WhereCondition:="[Hire Date] Between #" & _ Me.StartDate & "# AND #" & _ Me.EndDate & "#"
The simple parts that I know (or I think I do) is that I need to change where it says Report to Form (ex. ReportName to FormName, OpenReport to OpenForm). Another difference between this code and the code that I need, is that this code is looking for a range, whereas all I need is just the records that match the one text box. For example, if the user types in Arizona in the text box, only the records with Arizona in the specific field will be shown.
Any help would be awesome. Thanks