Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using forms 2

Status
Not open for further replies.

platypus71

Technical User
Sep 7, 2005
68
US
I have never done a form before and have been asked to set one up. I figured, complex queries are pretty easy, how hard can a form be? Riiiiight.

Here is what I have to work with:
Table with 20 fields. Important ones for this question are Name, Month, and Date. No fields are unique in the table. The Name field is the name of a class.

What I would like to do is create a form with the following:
At the top, show drop-down boxes for Name, Month, and Date. The contents of each box should be UNIQUE. I want the user to be able to select out of any/all of these boxes, then click a button. After the button is clicked, it opens a subform within the form that filters the table based on the criteria above.

Any help would be appreciated as I haven't a clue how to do this in a form. I wrote a macro that does this, but my end-users don't understand it if it isn't pretty like a form.

Thanks.
 
(evalesthy: always a star for referencing questions answered elsewhere!)

My preference is for a listbox, which can display your three fields but is bound to the primary key, on a highlevel or main form. Place subform in the first form which displays all of your data and linked to the mainforms' list. Users seelcting the list value will force the display of the data form.

A major drawback with this method is data entry (the data form should not allow data entry, which must be managed separately), but where the data is static this is very easy to navigate around all data.

Cheers

S
 
Working on the same form, I have encountered another problem. I have the drop down boxes in the original form. My first one with Name lists all the valid names, but when I try to select one, it dings at me and doesn't let me select it. My second one, Month, lists the same values as Name.

Any ideas what I missed in setting these up?
 
And another issue, still with the drop down boxes, is it lists all entries from the table. I want it to list the UNIQUE entries.
 
Why don't you try creating a query that you will use as the source for each drop down box? In order to get UNIQUE values you will want to change the SQL statement behind the query - have it look something like this:

Code:
SELECT Distinct Table.[Name]
FROM Table;

This should pull up only the unique values in the column "Name" from your table "Table".

Once you do that you can use the wizard to create your drop down and select your query as the source.


Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top