Using form to select information

  • Thread starter Thread starter RZM
  • Start date Start date
R

RZM

I have a table of work produced by employees each day, how
can I create a form which will allow me to select a
particular employee and a particular date which will
search my table and only return information on that
employee without having a primeter box popping up? Is
this possible? Does it involve some sort of programming?
Any input would be very much appreciated.
 
I have a table of work produced by employees each day, how
can I create a form which will allow me to select a
particular employee and a particular date which will
search my table and only return information on that
employee without having a primeter box popping up? Is
this possible? Does it involve some sort of programming?
Any input would be very much appreciated.

It's pretty easy using a reference to the form as a parameter. Create
a small *UNBOUND* form (you don't want to use bound controls since
they would update your database with your search terms!); say you have
a form frmCrit with a combo box cboEmployeeID and textboxes
txtDateFrom and txtDateTo. Use criteria

=Forms![frmCrit]![cboEmployeeID]

on the employee ID field, and
= CDate(Forms![frmCrit]![txtDateFrom] AND < DateAdd("d", 1, CDate(Forms![frmCrit]![txtDateTo]))

The elaborate date expressions will convert free-format dates to valid
date values and deal with the possibility that the date field contains
a time component, getting the records on the last day of the range.
 
RZM said:
I have a table of work produced by employees each day, how
can I create a form which will allow me to select a
particular employee and a particular date which will
search my table and only return information on that
employee without having a primeter box popping up? Is
this possible? Does it involve some sort of programming?


Create an unbound combo box and text box in the form's
header section where users can select the employee and enter
the date. Then change your query's criteria to use thos
controls on the form instead of {prompt string]. The
criteria will look something like:
Forms!theform.thecombobox
and
Forms!theform.thetextbox
 
Back
Top