Filter with a command button

  • Thread starter Thread starter Linda
  • Start date Start date
L

Linda

Hi,

I would like to create a button control on a form that
uses can click, type an invoice # and then that record is
displayed.

I can create a button, using the control wizard, but do
not know how to write the expression to ask the user what
invoice they want to retrieve, and then execute.

I am just learning Access myself with the on-line help.
I can do the filter with the access toolbars so I believe
this should be possible. Any help would be greatly
appreciated.

Thank you.
Linda
 
Linda

Another approach might be to use a combo box to list invoice # and other
identifying info (say, customer name), and allow the user to select the
invoice desired.

You could then use the AfterUpdate event and add a procedure that "gets" the
invoice. One way to do this is to create a query that uses what's been
selected in the combo box as a criterion for which record, and to bind your
form to that query. Then, in the AfterUpdate of the combo box, you'd use:

Me.Requery

to get the form to requery its underlying source.
 
Thanks much, that would work, however there will be
thousands of records each fiscal year. The users daily
must retrieve an invoice record to add information. They
will have the invoice, therefore have the number to find.

It is the only field of the entire record that is unique
to only one record. So if it is possible, for the user to
just click a button, type the invoice number to reive
and edit, it would be nice.

If I am understanding filters, this works quickly, but
takes a few steps. All of the users have never used
access before, so the simpler the better.

Thanks again. I am just learning myself and this
newsgroup sure helps. I can read posts/replys and even
if I don't understand it helps point me where to read
more on the subject.
 
If you are convinced that the users will have accurate access to the invoice
numbers, you could use a text box in place of the combo box, but leave
everything else the same (AfterUpdate, query with the text box's contents as
criterion, ...).

This would allow the user to enter an invoice number and hit <Tab> to
"filter"/load the record.
 
Back
Top