By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,153 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,153 IT Pros & Developers. It's quick & easy.

Toggle buttons to display an "X" if the item is selected

P: n/a
I am runing this function to toggle buttens to display an "X" when they
is selected, the butten is linked to a yes/no field. This function
works good, the problem I am having is that when I make a new record
the "X" from the last record I looked at are still there, but the
bottens are not selected nether should they be. How do I clear every
thing when creating a new record?
Any help would be apprecated.

Clarence Wollman
Function CheckClick() As Integer
'This function is used by Toggle buttons to display an "X" if the item
is selected.
If Screen.ActiveControl.Value = False Then
Screen.ActiveControl.Caption = ""
If Screen.ActiveControl.Value = True Then
Screen.ActiveControl.Caption = "X" 'Chr(252)
End Function

Jun 21 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

cwoll wrote:
I am runing this function to toggle buttens to display an "X" when they
is selected, the butten is linked to a yes/no field. This function
works good, the problem I am having is that when I make a new record
the "X" from the last record I looked at are still there,


Is the field in question is not bound to the form's recordsource, then
it won't automatically become blank/null. You'll have to set that
yourself in code.

Me.Controls("MyControl").Value=Null

Jun 22 '06 #2

P: n/a
How would be the best way to do this with about 50 controls without
haveing a lot of redundent code?
Thank you
CW
pietlin...@hotmail.com wrote:
cwoll wrote:
I am runing this function to toggle buttens to display an "X" when they
is selected, the butten is linked to a yes/no field. This function
works good, the problem I am having is that when I make a new record
the "X" from the last record I looked at are still there,


Is the field in question is not bound to the form's recordsource, then
it won't automatically become blank/null. You'll have to set that
yourself in code.

Me.Controls("MyControl").Value=Null


Jun 22 '06 #3

P: n/a

pietlin...@hotmail.com wrote:
cwoll wrote:
I am runing this function to toggle buttens to display an "X" when they
is selected, the butten is linked to a yes/no field. This function
works good, the problem I am having is that when I make a new record
the "X" from the last record I looked at are still there,


Is the field in question is not bound to the form's recordsource, then
it won't automatically become blank/null. You'll have to set that
yourself in code.

Me.Controls("MyControl").Value=Null


sorry, would have helped had I mentioned that you should do that in the
OnCurrent or AfterInsert event of the form... In your case,
After_Insert sounds more likely.

Jun 22 '06 #4

P: n/a
This thread is descibing exectly the problem that I am having, but they
did not come up
with an answer.
Thanks

http://groups.google.com/group/micro...a99c7a72089199

Jun 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.