Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Clearing Checkbox

I'm running code that Fills a Dataform <<and all fields are working fine
except for the last two items which are checkboxes: the final step should
fill in one of the two separate checkboxes on my frmPOReq, but right now
the frmPOReq is showing in some cases BOTH checkboxes checked, with one or
the other greyed out
on the form... Can someone tell me what I'm doing wrong here?

....Code before,,
If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = ""
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = ""
End If
frmPOReq.Show
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Clearing Checkbox

Hi Jim,

Change:

frmPOReq.ChkYes = ""


to

frmPOReq.ChkYes = False

Similarly, change:

frmPOReq.ChkNo = ""


to

frmPOReq.ChkNo = False

---
Regards,
Norman



"Jim May" wrote in message
news:QmlZe.121368$Ep.13713@lakeread02...
I'm running code that Fills a Dataform <<and all fields are working fine
except for the last two items which are checkboxes: the final step should
fill in one of the two separate checkboxes on my frmPOReq, but right now
the frmPOReq is showing in some cases BOTH checkboxes checked, with one or
the other greyed out
on the form... Can someone tell me what I'm doing wrong here?

...Code before,,
If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = ""
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = ""
End If
frmPOReq.Show
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Clearing Checkbox

Norman,, You nailed-it; (that was the prob)
Tks,
Jim

"Norman Jones" wrote in message
...
Hi Jim,

Change:

frmPOReq.ChkYes = ""


to

frmPOReq.ChkYes = False

Similarly, change:

frmPOReq.ChkNo = ""


to

frmPOReq.ChkNo = False

---
Regards,
Norman



"Jim May" wrote in message
news:QmlZe.121368$Ep.13713@lakeread02...
I'm running code that Fills a Dataform <<and all fields are working fine
except for the last two items which are checkboxes: the final step should
fill in one of the two separate checkboxes on my frmPOReq, but right now
the frmPOReq is showing in some cases BOTH checkboxes checked, with one
or the other greyed out
on the form... Can someone tell me what I'm doing wrong here?

...Code before,,
If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = ""
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = ""
End If
frmPOReq.Show
End Sub






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Clearing Checkbox

Jim,

I don't know what is causing the problem, there must be some code we aren't
seeing. But ...

You don't need two checkboxes. If you think about it, a checkbox is just a
switch, it is either True (checked) or not True (unchecked). Yes and no are
also different switch statuses, so use one checkbox to indicate Yes
(checked) or No (unchecked)

frmPOReq.chkYesNo = (Target.Offset(0, 17).Value = "Yes")
frmPOReq.Show
End Sub


--
HTH

Bob Phillips

"Jim May" wrote in message
news:QmlZe.121368$Ep.13713@lakeread02...
I'm running code that Fills a Dataform <<and all fields are working fine
except for the last two items which are checkboxes: the final step should
fill in one of the two separate checkboxes on my frmPOReq, but right now
the frmPOReq is showing in some cases BOTH checkboxes checked, with one or
the other greyed out
on the form... Can someone tell me what I'm doing wrong here?

...Code before,,
If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = ""
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = ""
End If
frmPOReq.Show
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clearing Checkbox

First try

If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = False
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = False
End If
frmPOReq.Show
End Sub

--
Regards,
Tom Ogilvy


"Jim May" wrote in message
news:QmlZe.121368$Ep.13713@lakeread02...
I'm running code that Fills a Dataform <<and all fields are working fine
except for the last two items which are checkboxes: the final step should
fill in one of the two separate checkboxes on my frmPOReq, but right now
the frmPOReq is showing in some cases BOTH checkboxes checked, with one or
the other greyed out
on the form... Can someone tell me what I'm doing wrong here?

...Code before,,
If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = ""
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = ""
End If
frmPOReq.Show
End Sub






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Clearing Checkbox

Right On !! - Tks Tom

"Tom Ogilvy" wrote in message
...
First try

If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = False
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = False
End If
frmPOReq.Show
End Sub

--
Regards,
Tom Ogilvy


"Jim May" wrote in message
news:QmlZe.121368$Ep.13713@lakeread02...
I'm running code that Fills a Dataform <<and all fields are working fine
except for the last two items which are checkboxes: the final step should
fill in one of the two separate checkboxes on my frmPOReq, but right now
the frmPOReq is showing in some cases BOTH checkboxes checked, with one
or
the other greyed out
on the form... Can someone tell me what I'm doing wrong here?

...Code before,,
If Target.Offset(0, 17).Value = "No" Then
frmPOReq.ChkNo = True
frmPOReq.ChkYes = ""
End If
If Target.Offset(0, 17).Value = "Yes" Then
frmPOReq.ChkYes = True
frmPOReq.ChkNo = ""
End If
frmPOReq.Show
End Sub






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
Code question for clearing a command checkbox. Newbeetle Excel Discussion (Misc queries) 4 February 13th 07 09:05 AM
Clearing #N/A's in one go? Lee Harris Excel Worksheet Functions 5 November 22nd 05 06:52 PM
Clearing #VALUE skateblade Excel Worksheet Functions 3 October 15th 05 10:34 PM


All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"