subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform "Hours" within my main form "Employees" with the employee
name being the linked field. I choose to close the main form with a Close
Form button from the wizard and it closes only the subform and then I have
to toggle on close form again to close the main form. How do I sychronize
both forms and close them together.
 
Make sure the code for the close looks like this (right click the
button for properties, go to the 'click event' and look for the line
with "DoCmd.Close"):

DoCmd.Close acForm, "MAINFORMNAME"




As a picky side note, your employees table should have a autonumber
field for the ID. Then your main form should have a combo box with a
hidden employeeID field and a shown employee name field. Then link the
subform to the main form by these ID fields. The reason you want to do
this is because two employees could have the same name, an employee
name could have been typed in wrong the first time, and frankly,
because storing the full name in your "Hours" table wastes a ton of
space when a long integer value will do just fine!

Hope that helps,
~J
 
Thanks, I will give this a try. On your picky note, that made good sense to
me. I will go back to my tables and link on the TMS Employee Number, that
is unique to each employee. Thanks Again

Melinda
 

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

Back
Top