more specifically

  • Thread starter Thread starter joemyre
  • Start date Start date
J

joemyre

Ok, more specifically, i don't need to append anything, or do any sort of
query like that. I just want to be able to have a form with about 15
items to it. The user can then pick an item and enter what they want to
search for in its field (multiple fields even to narrow the search). I
want a table returned though. Like how query results are returned. And
it has to be user friendsly to the max because for some odd reason the
people who are going to be using it have more access training than i do
but still have no clue. wew ok just had to vent. I hope that helps
narrow down my goals. Also, beyond the wizards I am pretty much helpless.
So a lot of the vb scripts that i have seen thrown around i have no clue
whats going on with them. Thanks again.

Joe
 
Hi,


Have you tried to use a filter by form (from the toolbar, when a form is in use) ? Seems to be the
easiest way to go, in this scenario.


Hoping it may help,
Vanderghast, Access MVP
 
The free downloadable sample database at www.bullschmidt.com/access uses
the query by form concept so that on the invoices dialog one can
optionally choose a rep, a customer, and perhaps a date range, click on
a button that says "Input," and then have the invoice form open up
showing all the invoices that match the criteria.

And here is how the query by form concept can work.

On the invoices dialog there are the following controls:
InvDateMin with DefaultValue of =DateSerial(Year(Date())-1,1,1)
InvDateMax with DefaultValue of =Date()
InvRepNum with DefaultValue of *
InvCustNum with DefaultValue of *

Also on the invoices dialog there is a command button called
cmdInput to open the invoices form with the following code behind
the OnClick property:
DoCmd.OpenForm "frmInv"

And of course there could be a button to open a report the same way:
DoCmd.OpenReport "rptInv", acViewPreview

The invoices form (frmInv) has RecordSource property of qryInv.

And the qryInv query's criteria for the InvDate field has:
Between [Forms]![frmInvDialog]![InvDateMin] And
[Forms]![frmInvDialog]![InvDateMax]

And the qryInv query's criteria for the RepNum field has:
Like [Forms]![frmInvDialog]![InvRepNum]

And the qryInv query's criteria for the CustNum field has:
Like [Forms]![frmInvDialog]![CustNum]

One related point is that you probably wouldn't want to allow blanks
(i.e. Nulls) in fields that are going to be used with Like in any
criteria for that field. Otherwise the blanks wouldn't be shown. And
to counter that you might consider creating the query's SQL statement
dynamically so that the criteria on a particular field isn't used
unless needed.

--
J. Paul Schmidt, Freelance Access and ASP Developer
http://www.Bullschmidt.com/Login.asp - Database on the Web Demo
http://www.Bullschmidt.com/Access
Sample Access Invoices Database


Posted via http://dbforums.com
 
Back
Top