One form to show all departments

desireemm

Registered User.
Local time
Today, 10:36
Joined
Dec 30, 2003
Messages
64
I was thinking of making my own switchboard, and instead of having buttons that you push to bring up different forms. I was thinking of having a listbox with the names of different departments, as soon as you click on the department their information pops up on that same form (not a differnt seperate form) is that understandable or am I not making any sense??
 
desiree,

You need to make an "unbound" list box. We'll call it MyListbox.
It obviously displays the names of your various departments.

In the AfterUpdate event of MyListbox, put:

Me.Requery

Then instead of basing your form on a table, base it on a
query. Under the department field, look for the Criteria
line. Enter:

Forms![YourMainForm]![MyListBox]

Then whenever you change the MyListbox, it will do a requery
and up will come all records for that department.

Also, If you were to launch a report for a department:

DoCmd.OpenReport "SomeReport",,,"[DepartmentName] = " & Me.MyListbox & "'"

You may want to set a default value for MyListbox so that
when the form first opens, you will have "something" to
look at.

Wayne
 
THANK YOU THANK YOU

YOU GUYS ARE GODS....THANK YOU SO MUCH. I have got alot to learn about programming, so I ordered alot of programming books and I'm taking a SQL class the end of January. Thanks so much for answering my questions, I sure do appreciate it.
 
desiree,

Some of the best "Gods" here are gals!

Hope to hear from you again.

Wayne
 
SORRY

Sorry about that I should have said guys and gals, I meant guys in general (slang I guess) referring to male/female. Your Gods and Goddess hows that??
 

Users who are viewing this thread

Back
Top Bottom