Transferring Current Record From One Form To Another

G

Guest

I have a form with a button that prints the currently viewed record this way

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

I have another form for a Work Order. I need to be able to the current record in the new form and print only that record. I can get the Work Order form to open fine but at the first record in the database instead of the one being viewed on the previous form. How can I get the second form to open with the same data as the first? Printing the second only the record I want isn't the problem, it's getting to that record without having to search for it that is.

Thanks
 
W

Wayne Morgan

There are several ways to get the second form to the desired record. If the
first form is still open, you could retrieve the record's ID field value
from the first form and move to that record or filter the form on that value
in the form's Load event. If the second form is opened from the first, you
could use the record's ID value in the DoCmd.OpenForm call as the Where
Condition argument. There are other ways also.
 

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