Query, Form (1 Viewer)

jenny23

Registered User.
Local time
Today, 04:17
Joined
Apr 1, 2004
Messages
47
Query, Form HELP PLEASE.

I have a table with 2 fields, baseball and soccer. I created a form that has 2 buttons, Baseball and Soccer. Then, If I click on Baseball button, then I'll see all baseball records. How do I do this?
Please help.

Thanks.

Jenny.
 

cogent1

Registered User.
Local time
Today, 12:17
Joined
May 20, 2002
Messages
315
You have to base your form on a query which returns different records depending on which button (or better, which option in an option group) is selected. First , we need to know how your table differentiates whether an entry relates to soccer or baseball. Besides, why have the results lumped together in one table? Surely the statistics for the two games are entirely different?
 

jenny23

Registered User.
Local time
Today, 04:17
Joined
Apr 1, 2004
Messages
47
This is the format of my tables.
Name Address Favorites
----- ------- --------
Jim 22 w st soccer
Dave 12 s st baseball
Mike 20 ave soccer
Kim 2 hwy baseball
etc......

Please help in detail.
I am newbie.

Thanks.
 

cogent1

Registered User.
Local time
Today, 12:17
Joined
May 20, 2002
Messages
315
There are many ways to accomplish what you want, but most of them involve a knowledge of things like combo boxes or simple event procedures. As you are a "newbie", you may not feel comfortable with these. To do what you require in the simplest, though not most elegant way, requires two queries called from your command buttons and two forms. Everything can then be done using Access's wizards.

Do you just want to show your data on the screen or are you planning to print reports from the data?
 

jenny23

Registered User.
Local time
Today, 04:17
Joined
Apr 1, 2004
Messages
47
Combo box or even procedure

I am planning to print out the report and to email to someone.... that is later use...
I think I prefer this way, combo boxes or simple event procedures, can you please show me how to do this in detail?

for now, I need a form that users can enter data and submit the form....

Thanks.

Jenny.
 

cogent1

Registered User.
Local time
Today, 12:17
Joined
May 20, 2002
Messages
315
To get you going and give you some experience, I suggest you do it this way to begin with. You can easily switch over to another method later without changing your table structure in any way.


First, create a query to select all Baseball records from your table. Use the Query Wizard to select all the fields you need. When you are prompted about opening or modifying the design, choose Modify.

The query grid appears. In the Criteria row under SportType, enter the word Baseball. If you run this query, it should only show you records relating to baseball.

While the records are displayed, click the arrow next to the New Object button on the toolbar.

Select AutoForm from the drop down list. A new form is created containing only your Baseball records.

A similar method can be used to create a form for Soccer Records, using the appropriate word in the criteria row of course.

Yoyu can use these forms to enter new records for the sport concerned. Even though the records are entered into different forms, they are stored in the same table. If you want to enter records from both sports at any one time, use a query based on your table, but don't enter anything in the criteria row. Your Baseball and Soccer forms can then be used to separate the records at will.

Post again when you have finished this set of procedures and I will show you how to alter the forms to make them more foolproof.
 

Users who are viewing this thread

Top Bottom