default values

R

Russ

I have a form with a command button that launches another form, form B. I
have succesfully filtered the selection so I only select form B for clients
that have the same company as selected in the original form. However, I can
not figure out how to set the default value of the company to the value in
the original form.

What i want to do is click the button and go to a blank form that has the
company name filled out with the same company name as the form I came from.
How do i do this?
 
T

Treebeard

Russ said:
I have a form with a command button that launches another form, form B. I
have succesfully filtered the selection so I only select form B for clients
that have the same company as selected in the original form. However, I can
not figure out how to set the default value of the company to the value in
the original form.

What i want to do is click the button and go to a blank form that has the
company name filled out with the same company name as the form I came from.
How do i do this?

In the "On Click" event of the button:

DoCmd.OpenForm "BlankFormName", acNormal, , , , , Me.CompanyName



In the "On Open" event of the blank form :

If Not IsNull(Me.OpenArgs) Then
Me.CompanyName= Me.OpenArgs
End If
 

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