affect form control value with another

mhakim

Member
Local time
Today, 14:11
Joined
Jan 25, 2021
Messages
72
JV-Post-button enable.png


hi dears
good day

i wish to find code to enable and disable JV_Post Button
when check box is YES THEN JV_Post Button become enable = no
 
Have you tried the AfterUpdate event of the checkbox? If the checkbox is bound, you might also try the Current event.
 
Checkboxes have a Click event, an AfterUpdate event, and a LostFocus event. One of these might be a perfect place to put code such as...

Code:
Private Sub JV_GL_Transfer_LostFocus()
    JV_Post = NOT JV_GL_Transfer
End Sub

Here is the general writeup for check boxes and in it you can see links to all of the events that apply to checkboxes.

 
check box is locked it already have automatic value i will not make any manual checking
so i just want to disable the button JV-Post when the check box value is yes

in other way
main idea for user is that if the check box is yes then he donot need to click button JV-Post
 
Code:
Private Sub Form_Current()
'   the enabled state of the command button 
'   is the inverse of the value of the checkbox
    Me.cmdButton.Enabled = Not Me.chkBox
End Sub
 
If the value for the check box comes from an underlying record, MarkK's suggestion of the Current event is probably the best choice.
 
Code:
Private Sub Form_Current()
'   the enabled state of the command button
'   is the inverse of the value of the checkbox
    Me.cmdButton.Enabled = Not Me.chkBox
End Sub
very good thanks
 

Users who are viewing this thread

Back
Top Bottom