Select data to display on form

S

Stacie

I have a form based on a query. The purpose is for the user to select his
department at the top and then enter all of his budget in the spend accounts.
I am able to get the report to go to the department stated in a combo box,
but what I would prefer is to display only the department selected. Thanks
in advance.
 
J

Jeff Boyce

Stacie

I'm confused...

You posted in the .forms newsgroup, and mentioned "a form based on a query"
and "display on form", but then described a "report".

Are you working with a form or a report?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Stacie

I'm using a form because I want the user to be able to enter their annual
expenses in a field on the form. Can data entry be done on a report?
 
J

Jeff Boyce

Stacie

In MS Access, "forms" are screens. Forms are used for data entry.

In MS Access, "reports" are designs intended for printing.

There may be some features in the latest version (2007), but I'm not aware
of a way to enter data via a "report" in the previous versions of Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Stacie

So then I was correct in starting with a form. How can I filter the form
data to show only the department number selected in the ComboBox?
 
J

Jeff Boyce

Stacie

One way to do this is to use an unbound combobox (I place mine in the form
header), and "feed" that combobox the (in your case) department numbers you
want the user to select from. Typically, there's a tlkpDepartment "lookup"
table that contains DeptID and DepartmentName. Both go to the query, but
only the DepartmentName is shown, to make it easier for the user to pick the
correct one (no need to memorize Dept#s!).

The form itself is based a query that's based on the ??? table (I can't
tell what table this is in your situation). In that query, add a Selection
Criterion for the DeptID that points back to the form ... something like:

Forms!YourFormName!cboYourPickADepartmentComboboxName

Now add an AfterUpdate event to the combobox that requeries the form,
something like:

Me.Requery

The next effect of all this is that the form opens (with nothing in the
combobox) and displays the record that corresponds to that nothing (i.e., no
record). Then the user selects a Department from the combobox and the
AfterUpdate event requeries the form, now selecting the record that has the
ID of the item selected in the combobox.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Stacie

Jeff,

thank you. All that was missing was the Me.requery. My form works as I
would like it to now.

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top