Select records with form driven input

D

Dick Patton

I know this one is really dumb, but i can't seem to get the technique to work.

Tables: MERIT BADGES containg a list of merit badges, SCOUT_ID containg info
on personal, MB_RESOLVER conatins links between a Merit Badge and a Scout ID.
So a Scout_ID can counsel many merit badges and a Merit badge can be
Counseled by many Scout_ID's.

Form: I would like a form that allows a Scout to select a Merit Badge (from
a list box) and retrive all Counselors (by Scout ID) that work with that
merit badge.

Query: I have a query that retrives all records and required information.
I can make it work with a "criteria : Like "*" & [Enter Merit Badge Name] &
"*"

I can't seem to get my Query to respond to a combo box on a form called
MB_QUERY. It just lets me choose an entry and does nothing!

What am i missing?

I get the correct data, but i can't seem to get that to work with the form???

HELP
 
B

Beetle

I don't know your field/object names so you'll have to
modify accordingly, but here is an example assuming that
the combo box resides on the same form that uses the query
in question as its record source;

1) In the criteria row of the merit badge column of your query
put;

Forms!YourFormName!YourComboBox

This will instruct the query to retrieve the value form the combo box
on your form.

2) In the After Update event of the combo box on your form put:

Me.Requery

This will requery to form when you make a new selection in the
combo box. If you don't know how to add this line of code to the
After Update event post back.
 
D

Dick Patton

Hi Sean,

Sorry for the delay getting back to you. have tried what you suggested and
the results are the same. Your solution seems so logical that it should
work.

I must be doing something wrong, First though how do i determine the
combobox nane to place in the Criteria?
________________ ___________________ ________________
| Merit Badge | | Resolver |
| Scout ID |
|MB_Code (key) | ---------->|MB Key (auto Number)| | Person_ID
|
|Merit Badge name| |Person_ID |<------|Person
Info |
|_______________| | |
|_______________|
|__________________ |

Sorry aboun the lousy art.

Any way... I have a query that selects records from Merit_bage using the
LIKE statement. I just don't understand how to get the data from the form.
Once data is selected the Scout needs to have the personal information using
the Person_ID key.

It just looks so easy, i can't get it to work.

Thanks for your help and have a great weekend.
 

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