Using a Checkbox to Update a Field in a Subform

G

Guest

Hello,

I have a form and a subform that share two fields. Is there a way when the
checkbox on the form is checked it will automatically insert the information
from the two fields on the form into the same two fields on the subform? I
use the checkbox when I submit a quote to a customer. The form is called
Solicitations and the subform is called Quotes.

Thanks in advance.
Mark
 
T

Tony Vrolyk

Are you familiar with VBA/Event proceduers? You could use the AfterUpdate
event of the check box to do something like (replace with your control
names)

If Me.chkBox = -1 then
Me!Quotes.Form!Control1= Me.Control1
Me!Quotes.Form!Control2= Me.Control2
End if

If you want to have the fields cleared if the users unchecks you could add
to it like this

If Me.chkBox = -1 then
Me!Quotes.Form!Control1= Me.Control1
Me!Quotes.Form!Control2= Me.Control2
Else
Me!Quotes.Form!Control1= Null
Me!Quotes.Form!Control2= Null
End if


good luck
Tony
 
Joined
Jul 15, 2011
Messages
4
Reaction score
0
How do you add checkboxes into a subform using vba? The subform is based on a query (a transform (pivot table creating at that)?
 

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