ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find End of String (https://www.excelbanter.com/excel-programming/368671-find-end-string.html)

ssjody[_8_]

Find End of String
 

Hi,
I have a form that has two text box's. Next to each of these tex
box's I have a checkbox. I want to allow the user to put a check nex
to the text box's values he wants to include in a thrid textbox o
another form. If there are more than one checkbox checked then I want
comma between each value. Here is generically what I'm trying to do.

Private Sub CommandButtonENGDescriptionNext_Click()
If Me.CheckBoxENGID.Value = True Then
Me.TextBoxDescriptionPageDescription.Value = Me.TextBoxEngineID.Value
End If
This is where I get stuck. What I want to happen is this:

Then If Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Append Me.TextBoxDescriptionPageDescription.Value = ", "
Me.ComboBoxAccessoriesYesNo.Value to the end of the string.
End If
End Sub

How do I do this?

Thanks Jod

--
ssjod
-----------------------------------------------------------------------
ssjody's Profile: http://www.excelforum.com/member.php...fo&userid=3339
View this thread: http://www.excelforum.com/showthread.php?threadid=56604


Die_Another_Day

Find End of String
 
Private Sub CommandButtonENGDescriptionNext_Click()
If Me.CheckBoxENGID.Value = True Then
Me.TextBoxDescriptionPageDescription.Value =
Me.TextBoxEngineID.Value
if Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Me.TextBoxDescriptionPageDescription.Value = _
Me.TextBoxDescriptionPageDescription.Value & _
"," & Me.ComboBoxAccessoriesYesNo.Value
End If
Else
if Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Me.TextBoxDescriptionPageDescription.Value = _
Me.ComboBoxAccessoriesYesNo.Value
end if
End if

HTH

Die_Another_Day


Then If Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Append Me.TextBoxDescriptionPageDescription.Value = ", " &
Me.ComboBoxAccessoriesYesNo.Value to the end of the string.
End If
End Sub

ssjody wrote:
Hi,
I have a form that has two text box's. Next to each of these text
box's I have a checkbox. I want to allow the user to put a check next
to the text box's values he wants to include in a thrid textbox on
another form. If there are more than one checkbox checked then I want a
comma between each value. Here is generically what I'm trying to do.

Private Sub CommandButtonENGDescriptionNext_Click()
If Me.CheckBoxENGID.Value = True Then
Me.TextBoxDescriptionPageDescription.Value = Me.TextBoxEngineID.Value
End If
This is where I get stuck. What I want to happen is this:

Then If Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Append Me.TextBoxDescriptionPageDescription.Value = ", " &
Me.ComboBoxAccessoriesYesNo.Value to the end of the string.
End If
End Sub

How do I do this?

Thanks Jody


--
ssjody
------------------------------------------------------------------------
ssjody's Profile: http://www.excelforum.com/member.php...o&userid=33398
View this thread: http://www.excelforum.com/showthread...hreadid=566040



Bob Phillips

Find End of String
 
Private Sub CommandButtonENGDescriptionNext_Click()
With Me
TextBoxDescriptionPageDescription.Text = ""
If .CheckBoxEngID.Value = True Then
.TextBoxDescriptionPageDescription.Value = _
.TextBoxEngineID.Value
End If

If .CheckBoxENGAccessoriesIncluded.Value = True Then
If .TextBoxDescriptionPageDescription.Value < "" Then
.TextBoxDescriptionPageDescription.Value = _
.TextBoxDescriptionPageDescription.Value & ", "
End If
.TextBoxDescriptionPageDescription.Value = _
.TextBoxDescriptionPageDescription.Value & _
.TextBoxENGAccessoriesIncluded.Text
End If
End With
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ssjody" wrote in
message ...

Hi,
I have a form that has two text box's. Next to each of these text
box's I have a checkbox. I want to allow the user to put a check next
to the text box's values he wants to include in a thrid textbox on
another form. If there are more than one checkbox checked then I want a
comma between each value. Here is generically what I'm trying to do.

Private Sub CommandButtonENGDescriptionNext_Click()
If Me.CheckBoxENGID.Value = True Then
Me.TextBoxDescriptionPageDescription.Value = Me.TextBoxEngineID.Value
End If
This is where I get stuck. What I want to happen is this:

Then If Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Append Me.TextBoxDescriptionPageDescription.Value = ", " &
Me.ComboBoxAccessoriesYesNo.Value to the end of the string.
End If
End Sub

How do I do this?

Thanks Jody


--
ssjody
------------------------------------------------------------------------
ssjody's Profile:

http://www.excelforum.com/member.php...o&userid=33398
View this thread: http://www.excelforum.com/showthread...hreadid=566040




DoctorG

Find End of String
 
result = if(not(isempty(result));result & ", ";"") & yourstring

"ssjody" wrote:


Hi,
I have a form that has two text box's. Next to each of these text
box's I have a checkbox. I want to allow the user to put a check next
to the text box's values he wants to include in a thrid textbox on
another form. If there are more than one checkbox checked then I want a
comma between each value. Here is generically what I'm trying to do.

Private Sub CommandButtonENGDescriptionNext_Click()
If Me.CheckBoxENGID.Value = True Then
Me.TextBoxDescriptionPageDescription.Value = Me.TextBoxEngineID.Value
End If
This is where I get stuck. What I want to happen is this:

Then If Me.CheckBoxENGAccessoriesIncluded.Value = True Then
Append Me.TextBoxDescriptionPageDescription.Value = ", " &
Me.ComboBoxAccessoriesYesNo.Value to the end of the string.
End If
End Sub

How do I do this?

Thanks Jody


--
ssjody
------------------------------------------------------------------------
ssjody's Profile: http://www.excelforum.com/member.php...o&userid=33398
View this thread: http://www.excelforum.com/showthread...hreadid=566040




All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com