PC Review


Reply
Thread Tools Rate Thread

CheckBox values based on Worksheet condition

 
 
Steve Morgan
Guest
Posts: n/a
 
      21st Jun 2010
I have six checkboxes on a user form. Each checkbox makes a condition in
the worksheet true if checked on the form. After clicking OK on the
userform, each worksheet condition is set to false, and only the checked
boxes are set to true. Is it possible to show the status of each worksheet
condition when the user form is opened by showing the corresponding checkbox
as checked?

Example:

In the worksheet,
Cond A = true
Cond B = false
Cond C = true
Cond D, E & F are all false.

When opening the user form, is it possible to populate the checkboxes for
CondA and CondC with an 'x' on the userform?

If so, how?
This is what I have so far, the name of the form is Manage_Feeds_Form.

Sub ShowFeedsForm()
'Check status of feeds and indicate on form

Manage_Feeds_Form.Show

If "CondA in the worksheet = true" Then cb_CondA.Value = True
ditto for CondB thru CondF

End Sub

Thanks,
Steve




 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      21st Jun 2010
Simplest way would be to include all the code for setting the form's
checkbox values in the form's Initialize event. In the userform module, in
the top middle dropdown select Userform and in the right dropdown select
Initialize to write the Event stub.

Alternatively you could do similar in your proc ShowFeedsForm, something
like this

Dim bFlag as boolean
Dim frm as Manage_Feeds_Form

bFlag = CondA in the worksheet
frm.cb_CondA.Value = bFlag
'etc
frm.Show

Regards,
Peter T



"Steve Morgan" <(E-Mail Removed)> wrote in message
news:4be56$4c1f89b6$621008c0$(E-Mail Removed)...
>I have six checkboxes on a user form. Each checkbox makes a condition in
>the worksheet true if checked on the form. After clicking OK on the
>userform, each worksheet condition is set to false, and only the checked
>boxes are set to true. Is it possible to show the status of each worksheet
>condition when the user form is opened by showing the corresponding
>checkbox as checked?
>
> Example:
>
> In the worksheet,
> Cond A = true
> Cond B = false
> Cond C = true
> Cond D, E & F are all false.
>
> When opening the user form, is it possible to populate the checkboxes for
> CondA and CondC with an 'x' on the userform?
>
> If so, how?
> This is what I have so far, the name of the form is Manage_Feeds_Form.
>
> Sub ShowFeedsForm()
> 'Check status of feeds and indicate on form
>
> Manage_Feeds_Form.Show
>
> If "CondA in the worksheet = true" Then cb_CondA.Value = True
> ditto for CondB thru CondF
>
> End Sub
>
> Thanks,
> Steve
>
>
>
>


 
Reply With Quote
 
Steve Morgan
Guest
Posts: n/a
 
      21st Jun 2010
Peter T -

Thanks. This worked great.

Steve



"Peter T" <(E-Mail Removed)> wrote in message
news:hvo5lh$nqq$(E-Mail Removed)...
> Simplest way would be to include all the code for setting the form's
> checkbox values in the form's Initialize event. In the userform module, in
> the top middle dropdown select Userform and in the right dropdown select
> Initialize to write the Event stub.
>
> Alternatively you could do similar in your proc ShowFeedsForm, something
> like this
>
> Dim bFlag as boolean
> Dim frm as Manage_Feeds_Form
>
> bFlag = CondA in the worksheet
> frm.cb_CondA.Value = bFlag
> 'etc
> frm.Show
>
> Regards,
> Peter T
>
>
>
> "Steve Morgan" <(E-Mail Removed)> wrote in message
> news:4be56$4c1f89b6$621008c0$(E-Mail Removed)...
>>I have six checkboxes on a user form. Each checkbox makes a condition in
>>the worksheet true if checked on the form. After clicking OK on the
>>userform, each worksheet condition is set to false, and only the checked
>>boxes are set to true. Is it possible to show the status of each
>>worksheet condition when the user form is opened by showing the
>>corresponding checkbox as checked?
>>
>> Example:
>>
>> In the worksheet,
>> Cond A = true
>> Cond B = false
>> Cond C = true
>> Cond D, E & F are all false.
>>
>> When opening the user form, is it possible to populate the checkboxes for
>> CondA and CondC with an 'x' on the userform?
>>
>> If so, how?
>> This is what I have so far, the name of the form is Manage_Feeds_Form.
>>
>> Sub ShowFeedsForm()
>> 'Check status of feeds and indicate on form
>>
>> Manage_Feeds_Form.Show
>>
>> If "CondA in the worksheet = true" Then cb_CondA.Value = True
>> ditto for CondB thru CondF
>>
>> End Sub
>>
>> Thanks,
>> Steve
>>
>>
>>
>>

>
>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum table values based on condition SCC Microsoft Excel Worksheet Functions 2 2nd Dec 2008 06:29 PM
Delete worksheet row based on condition =?Utf-8?B?bWllaw==?= Microsoft Excel Programming 3 23rd Aug 2007 07:16 PM
set checkbox condition based on compared field values lsb Microsoft Access Form Coding 3 22nd Jun 2006 08:04 AM
set checkbox condition based on comparing two fields =?Utf-8?B?TFNC?= Microsoft Access Form Coding 6 21st Jun 2006 06:50 PM
Cannot sum values based on condition =?Utf-8?B?TmVkIEZsYW5kZXJz?= Microsoft Excel Worksheet Functions 1 3rd Dec 2004 04:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:10 PM.