PC Review


Reply
Thread Tools Rate Thread

CheckBox populate by Listbox ???

 
 
If
Guest
Posts: n/a
 
      27th Nov 2004
Good evening,

I would like activated a check box (CheckYesNo) if a value is selected in a
drop-down list (cmbList).

I tested this but...

Private Sub cmbList_AfterUpdate()
Me.CheckYesNo.Value = True
End Sub

et ceci

Private Sub cmbList_AfterUpdate()
Me.CheckYesNo.Value = "Yes"
End Sub

Private Sub cmbList_AfterUpdate()
Me.CheckYesNo.Value = "-1"
End Sub

Private Sub cmbList_AfterUpdate()
Me.CheckYesNo.Value = "1"
End Sub


Thank you in advance for your assistance.


Yves


 
Reply With Quote
 
 
 
 
MacDermott
Guest
Posts: n/a
 
      27th Nov 2004
but... what?


"If" <(E-Mail Removed)> wrote in message
news:41a7dac4$0$7830$(E-Mail Removed)...
> Good evening,
>
> I would like activated a check box (CheckYesNo) if a value is selected in

a
> drop-down list (cmbList).
>
> I tested this but...
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = True
> End Sub
>
> et ceci
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "Yes"
> End Sub
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "-1"
> End Sub
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "1"
> End Sub
>
>
> Thank you in advance for your assistance.
>
>
> Yves
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?S3VydA==?=
Guest
Posts: n/a
 
      27th Nov 2004
> I would like activated a check box (CheckYesNo)
> if a value is selected in a drop-down list (cmbList).
>
> I tested this but...
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = True
> End Sub
>
> et ceci
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "Yes"
> End Sub
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "-1"
> End Sub
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "1"
> End Sub
>
> Yves


You need to tell it what was selected, if anything:
***************************************************

1) If you want the checkbox activated regardless of what
was selected, then:

Private Sub cmbList_AfterUpdate()
If IsNull(Me.cmbList).Value Then
Me.CheckYesNo.Value = False
Else
Me.CheckYesNo.Value = True
End If
End Sub

2) If you have something specific in mind, and cmbList stores a string:

Private Sub cmbList_AfterUpdate()
If Me.cmbList.Value = "red" Then
Me.CheckYesNo.Value = True
Else
Me.CheckYesNo.Value = False
End If
End Sub

3) If you have something specific in mind, and cmbList stores a number:

Private Sub cmbList_AfterUpdate()
If Me.cmbList.Value = 1 Then
Me.CheckYesNo.Value = True
Else
Me.CheckYesNo.Value = False
End If
End Sub

***************************************************
- Kurt
 
Reply With Quote
 
Dale Fye
Guest
Posts: n/a
 
      27th Nov 2004
It looks like what you want to do is populate the check box, if any value is
selected in the combo box. In which case, I would use:

Private Sub cmbList_AfterUpdate()

Me.CheckYesNo = NOT IsNull(Me.cmbList)

End Sub

HTH
Dale


 
Reply With Quote
 
If
Guest
Posts: n/a
 
      28th Nov 2004
Thanks to all

Yves


"Dale Fye" <(E-Mail Removed)> a écrit dans le message de news:
uW9W$(E-Mail Removed)...
> It looks like what you want to do is populate the check box, if any value
> is
> selected in the combo box. In which case, I would use:
>
> Private Sub cmbList_AfterUpdate()
>
> Me.CheckYesNo = NOT IsNull(Me.cmbList)
>
> End Sub
>
> HTH
> Dale
>
>



 
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
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Microsoft Excel Programming 3 18th Aug 2005 02:35 PM
Listbox selection to populate another listbox? Chris Kettenbach Microsoft ASP .NET 3 16th Jun 2005 10:19 PM
populate 1 listbox with another listbox and vice versa Dave Microsoft VB .NET 5 5th Jan 2005 07:58 AM
Master-Detail Datagrid -checkbox (once tick the checkbox, all the child checkbox is ticked) Agnes Microsoft VB .NET 0 16th Aug 2004 11:23 AM
Access 97: Populate ListBox based on another ListBox Mark Breitfeller Microsoft Access Form Coding 0 30th Sep 2003 07:01 PM


Features
 

Advertising
 

Newsgroups
 


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