Expression on text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a number of field names with combo boxes where the user can select a
number of options (Achieved, not achieved,) from field names e.g.
*Reading/writing
* Spelling

I want to create code on a unbound text box that will show all the field
names where the user has selected "not achieved" from the combo box. How
would i go about doing that?

Thanks
 
Hi Connie,

Perhaps something like this might get you started.

You'll need a command button to call the subroutine and a listbox into which
you'll write the
names of the fields where the user has selected "not achieved".
Call the command button cmdNotAchieved.

For the listbox set the Row Source Type = "value list".
Call the listbox lstNotAchieved and just paste this code into the form
module.

Private Sub CheckNotAchieved(frm As Object)
Dim ctr As Control
For Each ctr In frm.Controls
If ctr.ControlType = acComboBox Then
If ctr = "not achieved" Then
Me!lstNotAchieved.AddItem ctr.Properties("name")
End If
End If
Next ctr
End Sub

Private Sub cmdNotAchieved_Click()
CheckNotAchieved Me
End Sub

HTH -Linda
 
Back
Top