UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V < 1 2  (Go to first unread post)
   Reply to this topicStart new topic
> Date Field Required Based On Checkbox = True, Access 2016    
 
   
MSAccessOldTimer
post Jul 23 2019, 10:26 AM
Post#21



Posts: 13
Joined: 19-July 19



Thanks. That will finish up this part of the project.
Go to the top of the page
 
projecttoday
post Jul 23 2019, 10:48 AM
Post#22


UtterAccess VIP
Posts: 10,866
Joined: 10-February 04
From: South Charleston, WV


You're welcome.

--------------------
Robert Crouser
Go to the top of the page
 
MSAccessOldTimer
post Jul 24 2019, 04:20 AM
Post#23



Posts: 13
Joined: 19-July 19



I have the checkbox set up the way I want it. When "checked" it highlights a specific area of the form, give the user a custom message on whether to proceed or not, and if so, and does what I want it to do. So a new challenge. Is there a way to reverse code this? Let's say the checkbox is "checked" on a form, and now the user wants to "uncheck"? Is there a way to set up a custom message for "unchecking" the checkbox? Here is the 'On Click' code use to "check" the checkbox. Currently, if we "uncheck" the checkbox, it gives us the same message, and so it is a little confusing. The user has to select "NO", and then uncheck the checkbox, even then manually remove the date. It also be great (if possible) that when 'unchecking' the checkbox, it automatically deletes the date in the [txtPoweredEquipInactive_Date] field.

Thanks.

Dim iResponce As Integer
iResponce = MsgBox("You are revoking this Associates Powered Equipment License." _
& vbCrLf & "Do you wish to continue?", vbYesNo Or vbExclamation, "WARNING")
If iResponce = vbYes Then

Me.ckPoweredEquipInactive = True

Me.txtPoweredEquipInactive_Date.Enabled = True
Me.txtPoweredEquipInactive_Date.SetFocus
MsgBox "Please enter the InActive Date!", vbExclamation, "DATE REQUIRED"

Else
If iResponce = vbNo Then
Me.ckPoweredEquipInactive = False
lblLicenseRevoked.BackColor = vbBlack
BxPoweredEquip.BorderColor = RGB(164, 213, 226)
BxPoweredEquip.BorderWidth = 1

End If
End If
Go to the top of the page
 
projecttoday
post Jul 24 2019, 06:29 AM
Post#24


UtterAccess VIP
Posts: 10,866
Joined: 10-February 04
From: South Charleston, WV


You are confusing "Do You Wish to Continue?" with testing the actual value. So you want something like

iResponce = MsgBox("You are revoking this Associates Powered Equipment License." _
& vbCrLf & "Do you wish to continue?", vbYesNo Or vbExclamation, "WARNING")
If iResponce = vbYes Then

.....If Me.ckPoweredEquipInactive = True Then
..........Me.ckPoweredEquipinactive = False
..........etc.
.....Else
..........Me.ckPoweredEquipinactive = True
..........etc.
.....End If

Else

.....Exit Sub

End If


--------------------
Robert Crouser
Go to the top of the page
 
MSAccessOldTimer
post Jul 25 2019, 03:44 AM
Post#25



Posts: 13
Joined: 19-July 19



I understand now. I was sort of approaching this backwards. While it worked, it didn't give me an option if I wanted to back out of it. I reworked the code and it is now working the way I want. Thank you!
Go to the top of the page
 
projecttoday
post Jul 25 2019, 04:08 AM
Post#26


UtterAccess VIP
Posts: 10,866
Joined: 10-February 04
From: South Charleston, WV


You're welcome.

--------------------
Robert Crouser
Go to the top of the page
 
2 Pages V < 1 2


Custom Search


RSSSearch   Top   Lo-Fi    21st August 2019 - 07:20 AM