Link to home
Start Free TrialLog in
Avatar of Mark Wood
Mark WoodFlag for United States of America

asked on

Access 2010 Question

I have a form with 9 buttons on it.  What i need to do is when you click on any of the buttons on form1 it will open form2 and only show the records based on that button.

if button1 on form1 is for experts then it will open form2 and only have the records for experts available.

if button2 on form1 is for novice then it will open form2 and only have the records for novices available.

and so on.

Is that possible and how do you do it?
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i think this is a complicated question if you want to do it effeciently

You would make a click event as stated above for each button, then set the dataset to the table accordingly


IE


Sub Button1click (...bla) handles button1.click
  Form2.show()
  Form2.grid.datasource = datasource1
end sub

Sub Button2click (...bla) handles button2.click
  Form2.show()
  Form2.grid.datasource = datasource2
end sub

..etc
Avatar of Mark Wood

ASKER

ok i entered the code as follows:
DoCmd.OpenForm "IA Control Details", acNormal, "[IA Controls]![Control Level]='MAC 1 Classified'"

it returns all 1310 records instead of the 173 it should be. I have created queries that show me how many records there are for each level.
I got it working using the following

DoCmd.OpenForm "IA Control Details", , , "[Control Level]='MAC 1 Classified'"
Thanks
Thanks for the grade.  Good luck with your project.  -Jim