A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

on click = yes



 
 
Thread Tools Display Modes
  #1  
Old June 20th, 2009, 12:57 AM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default on click = yes

Hi
I would like the value of a yes/no field to change to yes on click of this
field in a form then update the value of a date field in the same form to
todays date.
Can anyone help with the code for this:?

Regards
Colin
  #2  
Old June 20th, 2009, 01:53 AM posted to microsoft.public.access.tablesdbdesign
Ken Snell [MVP]
external usenet poster
 
Posts: 279
Default on click = yes

What if the user wants to unclick the checkbox?

To always have a click mean "yes":

Private Sub NameOfCheckboxControl_Click()
Me.NameOfCheckboxControl.Value = True
Me.NameOfDateField.Value = Date()
End Sub

--

Ken Snell
MS ACCESS MVP
http://www.accessmvp.com/KDSnell/


"cjgav" wrote in message
news
Hi
I would like the value of a yes/no field to change to yes on click of this
field in a form then update the value of a date field in the same form to
todays date.
Can anyone help with the code for this:?

Regards
Colin



  #3  
Old June 20th, 2009, 06:08 PM posted to microsoft.public.access.tablesdbdesign
Bernard Peek[_3_]
external usenet poster
 
Posts: 42
Default on click = yes

In message , Steve
help_available_at_very_reasonable_rates@contactme .com writes
Put the following in the click event:

Me!NameOfYesNoField = "Yes"


You may prefer

Me!NameOfYesNoField= not Me!NameOfYesNoField

This causes the field to toggle back to No if the field is clicked
again.


--
Bernard Peek
  #4  
Old June 21st, 2009, 09:55 AM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default on click = yes

Hi Ken
That works fine . Thanks for that.

"Ken Snell [MVP]" wrote:

What if the user wants to unclick the checkbox?

To always have a click mean "yes":

Private Sub NameOfCheckboxControl_Click()
Me.NameOfCheckboxControl.Value = True
Me.NameOfDateField.Value = Date()
End Sub

--

Ken Snell
MS ACCESS MVP
http://www.accessmvp.com/KDSnell/


"cjgav" wrote in message
news
Hi
I would like the value of a yes/no field to change to yes on click of this
field in a form then update the value of a date field in the same form to
todays date.
Can anyone help with the code for this:?

Regards
Colin




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.