Display specific records in a subform using a dropdown list

joss54

New member
Local time
Today, 15:27
Joined
Apr 12, 2005
Messages
5
Hi to all,
I developed a database where I keep all the problems that I face and their solutions along with its category.

Now I want to have a form that when I choose each category, I should have all its records.

I heard that I should implement this by using a subform but I couldn't manage. With a search at the topics I've seen that I should use a macro but I don't know how to implement it.

Possibly after the lookup field I should have an After Update function but how can I connect it with the subform?

ex. at category "hardware: floppy" i have 2 records and i want to see only these, and when i choose category "hardware: hard disk" to have other 5 records of that category

Help plz?
 

Attachments

  • problem.JPG
    problem.JPG
    34 KB · Views: 246
create an unbound combo box and populate with the different categories you have from your categories table (assuming you have a category table), then reference the value chosen from the combo box as a parameter in your query i.e. [Forms]![FormName]![ControlName].

Eventually, in the after update event you should put Me.Requery so that every time you select a different category, your form will display only your matching records.
 
I have the combo box that looks at my table "categories", my form is called "problems1" and the combo box "lookup"

so the criteria for the query should be [Forms]![problems1]![lookup] ?

But when I insert Me.Requery at the form I have the error:
Microsoft Access can't find the macro 'Me.'

What should be the problem?
 
yes that's the way to reference a control on a form.

Where did you put the Me.Requery ?
 
that's the correct place.

Can you upload a sample of your database ?
 
in the After Update field, change it to Event Procedure click on the 3 dots and then type in me.requery.
However, I've tried this on your sample but the records still do not appear.
I don't know why as I'm having the same problem with a DB of mine.
I look forward to see some replies for a solution to 'our' problem.
 
After a bit of fiddling around I think I've got it working for you.
I used the 'on change' event if the lookup combo field.
I'll have to see if that change will make mine work. :D
 

Attachments

I found the solution!!!

When using a subform and calling "Me.Requery" I was calling only the outside form and not the subform...

You can also try the following

[Form_simple problems].Requery
 

Users who are viewing this thread

Back
Top Bottom