MS Access question
AsSiMiLaTeD
Posts: 11,728
Is there a way to filter a form based on a value selected in a combo box? I have a form built on a table, and one of the fields in that table is employee ID.
So basically, I'd like to select a name from the employee drop down list, and then only display values on the form that are for that employee.
Keep in mind that there is a one to many relationship between employee and records, so one employee may have 10 records assigned to them that they need to update.
Any thoughts?
So basically, I'd like to select a name from the employee drop down list, and then only display values on the form that are for that employee.
Keep in mind that there is a one to many relationship between employee and records, so one employee may have 10 records assigned to them that they need to update.
Any thoughts?
Post edited by AsSiMiLaTeD on
Comments
-
-
SELECT * FROM 'TableName' WHERE EmployeeID = x
E-mail or PM me and I can help further if needed. -
Make a combo box, with a query the employee ID# as the 'Row Source'.
then.... -
You'll need to make a macro and assign it to the box as well (im jumping around a little bit)
-
-
The macro code. apply your own names here of course
This goes in the Where Condition:
[Forms]![Form-Start]![Combo-Internal Num]=[Query-Client Information]![INTERNAL_A] -
So, in my example, a combo box is made on a 'Starting Form', you hit the drop down for your #, then it goes to the form with your info.
-
This is how it looks at first, if you start typing in a number it will try to match it, or select from a list. The list is populated by your query. The macro opens the form with your detailed info records.
-
Looks like you're using the ID as a combobox item, I would use the name and embed the ID into the tag property.
-
The macro code. apply your own names here of course
This goes in the Where Condition:
[Forms]![Form-Start]![Combo-Internal Num]=[Query-Client Information]![INTERNAL_A] -
No, that's not it....
-
I think I figured it out, will report back...
-
= [Name of query to extract Employee ID]![Name of Employee ID field on the form that has the detailed info]
-
NICE - that did the trick! CP to the rescue again! Thanks for your help!
-
May I ask what your application is for? You might be better off with SQL Server 2005 Express and VS Express if the app grows in functionality.
-
This is just a small Access database that'll probably never contain more than a few hundred records. However, our area is looking for an Enterprise reporting app. Right now most of our departments are using either Crystal or SQL RS - got any thoughts along those lines?
For some reason, they decided to have me lead the charge, even though I'm one of the least qualified people to do so. -
This is how it looks at first, if you start typing in a number it will try to match it, or select from a list. The list is populated by your query. The macro opens the form with your detailed info records.
Dude you are so good at script you should do an access database about how many Polkies are/have gang raped women due to the TBT.
Sorry I shall resist.Please. Please contact me a ben62670 @ yahoo.com. Make sure to include who you are, and you are from Polk so I don't delete your email. Also I am now physically unable to work on any projects. If you need help let these guys know. There are many people who will help if you let them know where you are.
Thanks
Ben -
Wtf?
-
MS is offensive.
engtazengtaz
I love how music can brighten up a bad day.