From: edmiller on 6 Dec 2009 21:24 Hi everyone, Help is greatly appreciated. I am using Access 97 (a bit behind I know, all we could afford :S) So I have a table (tblVendors) with 5 fields : Vendor ID, Vendor Name, Vendor Address, Vendor AB, Vendor FDL. I have a form (frmVendor) with two Text Boxes: Vendor_ID and Vendor_Name and one Command Button: (cmdSearch). The purpose of the form is for the User to input either the Vendor ID or the Vendor Name, click the Command Button (cmdSearch) and get the proper results. So I've used the QBF Technique. What I've done is on the "On Click" property of the Command Button (cmdSearch) run a Macro (SearchMacro) that the only thing it does is "Open a Query" that I've named qrySearch. In this Query (qrySearch) I've put the 5 fields of my initial table and below the Vendor ID and Vendor Name fields I've put: Forms!frmVendor!Vendor_ID and Forms!frmVendor!Vendor_Name respectively. So when the User types the Name of the Vendor or the Vendor ID on the form and clicks the Command Button the search results are perfectly displayed in a separate Datasheet view Window. So what I need to do is to display the results in the same Search Form. I'd like for the User to input the data, click the search button, and below in the same form display the results (not in a Datasheet view). How can I acomplish this?? What should I add to my form? Thank you in advance to all!!
From: Allen Browne on 6 Dec 2009 22:47 Ed, download the free sample database in this article: Search form - Handle many optional criteria at: http://allenbrowne.com/ser-62.html It shows how to build a filter string from whichever box(es) the user typed their criteria into, and then apply that as the Filter of the form. Consequently, the results show up in the form where the user entered their criteria. If you have never worked with VBA, it will take a bit of effort to follow what's going on, but it's worth it. You will use this filtering technique on lots of forms and also for reports. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "edmiller" <u56701(a)uwe> wrote in message news:a035e9236b5f3(a)uwe... > Hi everyone, > > Help is greatly appreciated. > > I am using Access 97 (a bit behind I know, all we could afford :S) > > So I have a table (tblVendors) with 5 fields : Vendor ID, Vendor Name, > Vendor > Address, Vendor AB, Vendor FDL. > > I have a form (frmVendor) with two Text Boxes: Vendor_ID and Vendor_Name > and > one Command Button: (cmdSearch). > > The purpose of the form is for the User to input either the Vendor ID or > the > Vendor Name, click the Command Button (cmdSearch) and get the proper > results. > > So I've used the QBF Technique. What I've done is on the "On Click" > property > of the Command Button (cmdSearch) run a Macro (SearchMacro) that the only > thing it does is "Open a Query" that I've named qrySearch. > In this Query (qrySearch) I've put the 5 fields of my initial table and > below > the Vendor ID and Vendor Name fields I've put: Forms!frmVendor!Vendor_ID > and > Forms!frmVendor!Vendor_Name respectively. > So when the User types the Name of the Vendor or the Vendor ID on the form > and clicks the Command Button the search results are perfectly displayed > in a > separate Datasheet view Window. > > So what I need to do is to display the results in the same Search Form. > I'd > like for the User to input the data, click the search button, and below in > the same form display the results (not in a Datasheet view). How can I > acomplish this?? What should I add to my form? > > Thank you in advance to all!! >
|
Pages: 1 Prev: Passing Values between forms Next: Update a combobox on another form |