Input from Subform to a newly opened form




I have a form that has 2 subfroms on it. What I am wanting to do is;

On click of a date field in subform2 (Datasheet view)
Fields are: [date], [amount], [correction], [payment], [total]

opens a customer payment form (this part works fine). Now I want the date
from the field clicked in subform2 to be the default value in the date paid
field on the newly opened customer payment form.

Using Access 2003


If you are doing the OpenForm method from the click event of the date
control, you can pass the date to the form you are opening using the OpenArgs
argument of the OpenForm method. Then in the form being opened, you can use
the form's OpenArgs property to populate the control on the form with the
value received.

In the open form:
Docmd.OpenForm "CustomerFormName", , , , , , Me.TheDate

In the Load event of the customer form:

Me.TheDateControl = Me.OpenArgs

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