Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help w/ getting chkbox to automatically check.

Status
Not open for further replies.

cbearden

Technical User
May 17, 2004
80
US
I have a form with 5 different categories. I have 5 different types of costs: G, SC, CL, O, M.

Each of these fields have 3 controls: Cost, Refund Amt, Refund Date. When the cost is $0.00(customer does not have this), then the refund amt and refund date controls are disabled.

how could I go about getting a chkbox to automatically check when all ENABLED refund amt and refund date controls have a value other than NULL.

Thanks for the help!
 
cbearden,
Code:
If [blue]ControlName1[/blue].Enabled And [blue]ControlName2[/blue].Enabled Then
    If Not IsNull([blue]ControlName1[/blue]) And Not IsNull([blue]ControlName2[/blue]) Then
        Me![blue]MyCheckBox[/blue] = True
    End If
End If
HTH,

Ken S.
 
I tried the code but nothing happens to the chkbox.
 
I tried BeforeUpdate and AfterUpdate of the Form.

Here's the code:

If curGrefund.Enabled And dtmGrec.Enabled And _
curSCrefund.Enabled And dtmSCrec.Enabled And _
curCLrefund.Enabled And dtmCLrec.Enabled And _
curOrefund.Enabled And dtmOrec.Enabled And _
curMPPrefund.Enabled And dtmMPPrec.Enabled Then
If Not IsNull(curGrefund) And Not IsNull(dtmGrec) And _
Not IsNull(curSCrefund) And Not IsNull(dtmSCrec) And _
Not IsNull(curCLrefund) And Not IsNull(dtmCLrec) And _
Not IsNull(curOrefund) And Not IsNull(dtmOrec) And _
Not IsNull(curMPPrefund) And Not IsNull(dtmMPPrec) Then
Me!chkAll = True
End If
End If
 
I would put it in the On Current event. You could also put it in the AfterUpdate events of the textboxes.

Ken S.
 
I tried the OnCurrent but nothing happened.

I think what I'm going to do is just make a chkbox for each control(minus the 1st one for each category) and have it chked(while setting Visible to No). And then right code using those to chk the chkbox chkALL.
 
Have you set any breakpoints in your code to see where it's going wrong?

Ken S.
 
I tried it like I posted and when it didn't work, I tried just one category. Still didn't work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top