Clicking one control to change another.??

G

Guest

I have a control button on a form that duplicates the entire form... this
meets all my needs, except for one.

one field or control on the form is a checkbox.... it gets clicked once a
booking has been "confirmed"..... when I use the duplicate buton... it
duplicates the state of that button..... what I would really like is to have
that chceckbox return to being "un checked" on the duplicate copy of the
entry.

Any ideas??

Thanks
 
M

MA

Trial said:
I have a control button on a form that duplicates the entire form...
this meets all my needs, except for one.

one field or control on the form is a checkbox.... it gets clicked
once a booking has been "confirmed"..... when I use the duplicate
buton... it duplicates the state of that button..... what I would
really like is to have that chceckbox return to being "un checked" on
the duplicate copy of the entry.

Any ideas??

Thanks

Forms!YrSecondForm!Yourcheck = false

--
_ _
Ciao
MAssimiliano Amendola www.accessgroup.it
Cisa - Conferenza Italiana per Sviluppatori Access
Info: www.donkarl.com/it
 
D

Dirk Goldgar

Trial & Error said:
I have a control button on a form that duplicates the entire form...
this meets all my needs, except for one.

one field or control on the form is a checkbox.... it gets clicked
once a booking has been "confirmed"..... when I use the duplicate
buton... it duplicates the state of that button..... what I would
really like is to have that chceckbox return to being "un checked" on
the duplicate copy of the entry.

Any ideas??

That'll depend on the code for the button that duplicates the record.
Please post that code. It's probably just a matter of adding a line.
after the duplication has taken place, to set the checkbox to False;
e.g..,

Me!MyCheckBox = False
 
G

Guest

Heres the code for the duplication button....

Private Sub Duplicate_Registration_Click()
On Error GoTo Err_Duplicate_Registration_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

Exit_Duplicate_Registration_Click:
Exit Sub

Err_Duplicate_Registration_Click:
MsgBox Err.Description
Resume Exit_Duplicate_Registration_Click

End Sub
 
D

Dirk Goldgar

Trial & Error said:
Heres the code for the duplication button....

Private Sub Duplicate_Registration_Click()
On Error GoTo Err_Duplicate_Registration_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append

Exit_Duplicate_Registration_Click:
Exit Sub

Err_Duplicate_Registration_Click:
MsgBox Err.Description
Resume Exit_Duplicate_Registration_Click

End Sub

Then basically all you have to do is add a line similar to

Me!MyCheckBox = False

(replacing "MyCheckBox" with the name of your check box control), after
the third DoCmd statement and before the
Exit_Duplicate_Registration_Click label. However, you may not actually
see that the check box's value has been changed unless you set focus to
it. That's what happened with a text box I tested this on, and I think
it's a display bug. So you may need to do this:

Me!MyCheckBox = False
Me!MyCheckBox.SetFocus

If you want to, you can set the focus to the check box and then to some
other control.
 

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