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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

trying to option group delete field data



 
 
Thread Tools Display Modes
  #1  
Old November 13th, 2009, 04:58 AM posted to microsoft.public.access.forms
scottyboyb
external usenet poster
 
Posts: 36
Default trying to option group delete field data

Greetings, another trip to the well. The following code works except for:
Me!grpHowPaid.Value = ""

Here is the code. It is in the after update and form current events. Can
someone please tell me what little secret I do not know about deleting values
in option groups?

Private Sub chkPaid_AfterUpdate()
If Me!chkPaid = False Then
Me!txtPaymentDate.Visible = False
Me!grpHowPaid.Visible = False
Me!txtPaymentDate.Value = ""
Me!grpHowPaid.Value = ""
Else
Me!txtPaymentDate.Visible = True
Me!grpHowPaid.Visible = True
End If
End Sub

Many thanks,
Scott
  #2  
Old November 13th, 2009, 06:23 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default trying to option group delete field data

Set the values to Null, not to a zero-length string, e.g.:
Me!txtPaymentDate = Null

This would be a really bad idea in the form's Current event though (assuming
they are bound controls.) As soon as you visit any record, you would lose
the contents of these fields.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"scottyboyb" wrote in message
...
Greetings, another trip to the well. The following code works except for:
Me!grpHowPaid.Value = ""

Here is the code. It is in the after update and form current events. Can
someone please tell me what little secret I do not know about deleting
values
in option groups?

Private Sub chkPaid_AfterUpdate()
If Me!chkPaid = False Then
Me!txtPaymentDate.Visible = False
Me!grpHowPaid.Visible = False
Me!txtPaymentDate.Value = ""
Me!grpHowPaid.Value = ""
Else
Me!txtPaymentDate.Visible = True
Me!grpHowPaid.Visible = True
End If
End Sub

Many thanks,
Scott


 




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 06:47 AM.


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