On Thu, 05 Nov 2009 16:30:56 -0800, Repent wrote:
Reply interspersed below.
Those of us who reply to questions often have no idea of the actual
field and control names used by the questioner (unless he/she gives us
that information).
So, we use generic terms, such as ControlName, TableName, YourTable,
FieldName, FormName, etc.
You have to replace those generic names with the actual names of the
objects.
what do i put for "checkname" is it the name of the checkbox? in this
case its Payoff-Blue Factory Splices. Do i need to do something about
the spaces in the name?
Yes it's the name of the check box control (which may, or may not, be
the same as the field name to which the control is bound).
If the name includes spaces, always enclose it within brackets, i.e.
Me.[Payoff-Blue Factory Splices]
Note: It's never a good database design practice to include spaces
within field or control names. Payoff-BlueFactorySplices contains no
spaces and is just as easy to read as Payoff-Blue Factory Splices.
also what about textcontrolname and itemname what values go there?
In place of textcontrolname write the actual name of the text control
in which you wish to display the data. If the name has spaces within
it, i.e. "All my splices", make sure you enclose it within brackets,
[All my splices].
Replace ItemName with whatever it is you wish to enter into the text
control. Enclose it within quotes, i.e. "My Text"
So if we name the text control "All My Splices", the resulting code
would look like:
If Me.[Payoff-Blue Factory Splices] = -1 Then
Me.[All My Splices] = Me.[All My Splices] & "My text" & vbNewLine
Else
Me.[All My Splices] = Replace(Me.[All My Splices],"My text" &
vbNewLine,"")
End If
Each check box name will be different and the ItemText for each will
differ. The text control [All My Splices] will remain the same.
chris
On Thu, 05 Nov 2009 11:12:52 -0800, Repent wrote:
I have a form with many yes/no checkboxes on it.
if the user has had an issue with a particular item, he checkes the
box under that item. I'd then like to have a list box on another part
of the form to list those items the user placed a check next to.
The idea is that the checkboxes the user has to decide on live deep in
the form so if there was a list box of all the items that are checked
on the front of the form, it would make it easier for the user to see
all his choices.
the list box at this point only need to be a listing of those checked
items, one item per line.
how can I do this?
thanks all;
So you just wish to display the items checked as the operator is
entering them ... without saving this data?
Add an unbound text control to the form.
Size it tall enough to display expected data.
Add a vertical scroll bar if you think it might be needed.
Then code the AfterUpdate event of each Check box field:
If Me.CheckName = -1 Then
Me.TextControlName = Me.TextControlName & "ItemName" & vbNewLine
Else
Me.TextControlName = Replace(Me.TextControlName,"ItemName" &
vbNewLine,"")
End If
The appropriate field name will be added to the text control if the
check box is checked.
If the check is later removed from the check box, the Item name will
be removed from the text control.
To clear the check box when navigating to a different record, code the
Form's Current event:
Me.TextControlName = Null