Pop-up Form- really need help

S

Stewie

I have looked at other postings and none seem to help with my
particular situation. Will be very grateful for any assistance.


I am building an employee database with general employee information.
On the form that is connected to the employee table there is a command
button that I would like to have launch the form for another table in
the database. The table captures monthly coaching sessions and other
info.

What I need to happen is when I am in the employees profile and I
click on this button their monthly coachings pop-up but only
theirs(the table stores all the coaching for all employees). The
employee table has an employeeID that is unique to each record. The
coaching table has a combo box that looks up all the employeeID's from
my employees table. I would also like to add new records to the table.

My last problem is that when I make a new record using the form for
the coaching table the combo box that I use to choose an employeeID
form the list stores the index value instead of the employeesID. How
do I change this?


Sincerely,

Newbie at you mercy.
 
A

Albert D. Kallal

The code behind the button that launches this new "details" with coaching
can use the "where" clause to restrict the records to the given employees
ID.

The code will look like:

dim strWhere as string

strWhere = "EmployeeID = " & me!EmployeeID

me.refresh
docmd.OpenForm "frmCoaching",,,strWhere

Note that you need to change/use the correct field name from table
"coaching" that you used to "relate" back the employee table. So, in the
above I "guessed" the name of the field in the coaching table that looks to
the correct record. (just change the above to reflect the correct field name
in the coaching table). eg:

strWhere = "FieldInCoachWithEmployeeID = " & me!EmployeeIDFieldInThisform

The above will thus open the coaching form and ONLY show records that belong
to the given employee id

My last problem is that when I make a new record using the form for
the coaching table the combo box that I use to choose an employeeID
form the list stores the index value instead of the employeesID. How
do I change this?

Delete and then Re-make the combo box with the wizard. Make sure you select
the right field for the combo box to store its value into. (you likely
accidentally have the bound column setting to 0 which means return he index
value..if you change the bound column setting to "1", and your FIRST column
of the combo is the employeesID, then that should fix this. ---- it might be
just easer to re-make the combo box via the wizard then to check the bound
column setting, and also check what field is the first column of your combo
box).
 
S

Stewie

Thank you!

By helping me with my last question I remebered tha when your placing
a new command button you can tell it to match criteria when launching
a form. It didn't work before because I had the wrong column bond.

Thank you!
 

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