Create text string from Combo Box choices

  • Thread starter Thread starter cw via AccessMonster.com
  • Start date Start date
C

cw via AccessMonster.com

1) I have 8 Combo boxes on my form each with 2-3 choices.
2) The user selects from the choices, for example:

ComboBox1: DSL will not sync Up
ComboBox2: White XAVI X7868r+
ComboBox3: PWR solid but DSL/LNK is flashing
ComboBox4: Cycled power on the Modem, but no change
ComboBox5: I verified all cables and filters w/Customer
ComboBox6: Provisioning finished, but showing OOS,LOS
ComboBox7: Provisioning finished, no input packets
ComboBox8: Check COLLO and/or Dmarc.

3) I then take the user's choices and create a "text string" like this:

Trouble Description: DSL will not sync up.
--------------------------------------------------------
Cabling/Setup : I verified all cables and filters w/Customer
Modem Model # : White XAVI X7868r+
Modem Status : PWR solid but DSL/LNK is flashing
Modem Testing : Cycled power on the Modem, but no change
Calix Status : Provisioning finished, but showing OOS,LOS
Router Status : Provisioning finished, no input packets
--------------------------------------------------------
Trouble Suggestions: Check COLLO and/or Dmarc.

Any ideas?
I currently have a command button at the bottom of my Form to put the code
behind.
Thanks in advance for your help,
cw
 
Thank-you Klatuu!

I ended up using :
-----------------------
Private Sub Command22_Click()
Dim TextDetails1 As String
Dim TextDetails2 As String
Dim TextDetails3 As String
Dim TextDetails4 As String
Dim TextDetails5 As String
Dim TextDetails6 As String
Dim TextDetails7 As String
Dim TextDetails8 As String
Dim TextSummary As String

Me.TextDetails1 = Me.ComboBox1.Value
Me.TextDetails2 = Me.ComboBox2.Value
Me.TextDetails3 = Me.ComboBox3.Value
Me.TextDetails4 = Me.ComboBox4.Value
Me.TextDetails5 = Me.ComboBox5.Value
Me.TextDetails6 = Me.ComboBox6.Value
Me.TextDetails7 = Me.ComboBox7.Value
Me.TextDetails8 = Me.ComboBox8.Value

Me.TextSummary = "Trouble Description: " & Me.TextDetails1 & vbCr & "---------
-----------------------------------------------" & vbCr & "Cabling/Setup : "
& Me.TextDetails2 & vbCr & "Modem Model # : " & Me.TextDetails3 & vbCr &
"Modem Status : " & Me.TextDetails4 & vbCr & "Modem Testing : " & Me.
TextDetails5 & vbCr & "Calix Status : " & Me.TextDetails6 & vbCr & "Router
Status : " & Me.TextDetails7 & vbCr & "--------------------------------------
------------------" & vbCr & "Trouble Suggestions: " & Me.TextDetails8

Forms!GoogleEye!WebBrowser1.Document.Forms(0).all("ticketDetail").Value =
Forms!GoogleEye!TextSummary
End Sub
------------------------------------------------------------------------------


The Concatenated string is working fine except for:
One issue is that when I paste the TextSummary text, it doesn't like the vbCr?

It is saying [object] in the textbox.

I need to have the string automatically break at the end of each line so it
is readable when pasted.
Any other ideas would be much appreciated.
Thanks again,
cw.

strTroubleReport = Me.ComboBox1 & " " & Me.ComboBox2 & " " & etc, etc,
1) I have 8 Combo boxes on my form each with 2-3 choices.
2) The user selects from the choices, for example:
[quoted text clipped - 26 lines]
Thanks in advance for your help,
cw
 
Where you have vbcr, try using

& Chr(13) & Chr(10) &

cw via AccessMonster.com said:
Thank-you Klatuu!

I ended up using :
-----------------------
Private Sub Command22_Click()
Dim TextDetails1 As String
Dim TextDetails2 As String
Dim TextDetails3 As String
Dim TextDetails4 As String
Dim TextDetails5 As String
Dim TextDetails6 As String
Dim TextDetails7 As String
Dim TextDetails8 As String
Dim TextSummary As String

Me.TextDetails1 = Me.ComboBox1.Value
Me.TextDetails2 = Me.ComboBox2.Value
Me.TextDetails3 = Me.ComboBox3.Value
Me.TextDetails4 = Me.ComboBox4.Value
Me.TextDetails5 = Me.ComboBox5.Value
Me.TextDetails6 = Me.ComboBox6.Value
Me.TextDetails7 = Me.ComboBox7.Value
Me.TextDetails8 = Me.ComboBox8.Value

Me.TextSummary = "Trouble Description: " & Me.TextDetails1 & vbCr & "---------
-----------------------------------------------" & vbCr & "Cabling/Setup : "
& Me.TextDetails2 & vbCr & "Modem Model # : " & Me.TextDetails3 & vbCr &
"Modem Status : " & Me.TextDetails4 & vbCr & "Modem Testing : " & Me.
TextDetails5 & vbCr & "Calix Status : " & Me.TextDetails6 & vbCr & "Router
Status : " & Me.TextDetails7 & vbCr & "--------------------------------------
------------------" & vbCr & "Trouble Suggestions: " & Me.TextDetails8

Forms!GoogleEye!WebBrowser1.Document.Forms(0).all("ticketDetail").Value =
Forms!GoogleEye!TextSummary
End Sub
------------------------------------------------------------------------------


The Concatenated string is working fine except for:
One issue is that when I paste the TextSummary text, it doesn't like the vbCr?

It is saying [object] in the textbox.

I need to have the string automatically break at the end of each line so it
is readable when pasted.
Any other ideas would be much appreciated.
Thanks again,
cw.

strTroubleReport = Me.ComboBox1 & " " & Me.ComboBox2 & " " & etc, etc,
1) I have 8 Combo boxes on my form each with 2-3 choices.
2) The user selects from the choices, for example:
[quoted text clipped - 26 lines]
Thanks in advance for your help,
cw
 
Or try vbCrLf...

Klatuu said:
Where you have vbcr, try using

& Chr(13) & Chr(10) &

cw via AccessMonster.com said:
Thank-you Klatuu!

I ended up using :
-----------------------
Private Sub Command22_Click()
Dim TextDetails1 As String
Dim TextDetails2 As String
Dim TextDetails3 As String
Dim TextDetails4 As String
Dim TextDetails5 As String
Dim TextDetails6 As String
Dim TextDetails7 As String
Dim TextDetails8 As String
Dim TextSummary As String

Me.TextDetails1 = Me.ComboBox1.Value
Me.TextDetails2 = Me.ComboBox2.Value
Me.TextDetails3 = Me.ComboBox3.Value
Me.TextDetails4 = Me.ComboBox4.Value
Me.TextDetails5 = Me.ComboBox5.Value
Me.TextDetails6 = Me.ComboBox6.Value
Me.TextDetails7 = Me.ComboBox7.Value
Me.TextDetails8 = Me.ComboBox8.Value

Me.TextSummary = "Trouble Description: " & Me.TextDetails1 & vbCr &
"---------
-----------------------------------------------" & vbCr & "Cabling/Setup
: "
& Me.TextDetails2 & vbCr & "Modem Model # : " & Me.TextDetails3 & vbCr &
"Modem Status : " & Me.TextDetails4 & vbCr & "Modem Testing : " & Me.
TextDetails5 & vbCr & "Calix Status : " & Me.TextDetails6 & vbCr &
"Router
Status : " & Me.TextDetails7 & vbCr &
"--------------------------------------
------------------" & vbCr & "Trouble Suggestions: " & Me.TextDetails8

Forms!GoogleEye!WebBrowser1.Document.Forms(0).all("ticketDetail").Value =
Forms!GoogleEye!TextSummary
End Sub
------------------------------------------------------------------------------


The Concatenated string is working fine except for:
One issue is that when I paste the TextSummary text, it doesn't like the
vbCr?

It is saying [object] in the textbox.

I need to have the string automatically break at the end of each line so
it
is readable when pasted.
Any other ideas would be much appreciated.
Thanks again,
cw.

strTroubleReport = Me.ComboBox1 & " " & Me.ComboBox2 & " " & etc, etc,

1) I have 8 Combo boxes on my form each with 2-3 choices.
2) The user selects from the choices, for example:
[quoted text clipped - 26 lines]
Thanks in advance for your help,
cw
 
Thanks to both of you!
I used vbCrLf & it properly formatted the lines.

One last issue: I'm having trouble forwarding the completed TextSummary
string to my underlying Main Form.

I added a Text box to my Main Form
& made it's Control Source = Forms![frmTicketTemplatesDSL]![TextSummary]
but the value of TextSummary is not being forwarded to the Main Form's Text
Box ?

It says : #Name?
How do I forward the new string to this text box?

Thanks again,
cw

Or try vbCrLf...
Where you have vbcr, try using
[quoted text clipped - 61 lines]
 
Add another line of code to the button after all your prior code to populate
the text box on the main form:

Me.Parent!YourTextBox = strTroubleReport

(using the same variable name that Klatuu supplied)

You *may* also need to do a form refresh, I'm foggy this early...
--
hth,
SusanV




cw via AccessMonster.com said:
Thanks to both of you!
I used vbCrLf & it properly formatted the lines.

One last issue: I'm having trouble forwarding the completed TextSummary
string to my underlying Main Form.

I added a Text box to my Main Form
& made it's Control Source = Forms![frmTicketTemplatesDSL]![TextSummary]
but the value of TextSummary is not being forwarded to the Main Form's
Text
Box ?

It says : #Name?
How do I forward the new string to this text box?

Thanks again,
cw

Or try vbCrLf...
Where you have vbcr, try using
[quoted text clipped - 61 lines]
Thanks in advance for your help,
cw
 
Susan, Thank-you again for your help.
That did the trick.
Heres my finished code for the button.

Private Sub Command22_Click()
Dim TextDetails1 As String
Dim TextDetails2 As String
Dim TextDetails3 As String
Dim TextDetails4 As String
Dim TextDetails5 As String
Dim TextDetails6 As String
Dim TextDetails7 As String
Dim TextDetails8 As String
Dim TextSummary As String

Me.TextDetails1 = Nz(Me.ComboBox1.Value)
Me.TextDetails2 = Nz(Me.ComboBox2.Value)
Me.TextDetails3 = Nz(Me.ComboBox3.Value)
Me.TextDetails4 = Nz(Me.ComboBox4.Value)
Me.TextDetails5 = Nz(Me.ComboBox5.Value)
Me.TextDetails6 = Nz(Me.ComboBox6.Value)
Me.TextDetails7 = Nz(Me.ComboBox7.Value)
Me.TextDetails8 = Nz(Me.ComboBox8.Value)

Me.TextSummary = "Trouble Description: " & Me.TextDetails1 & vbCrLf & "-------
-------------------------------------------------" & vbCrLf & "Cabling/Setup
: " & Me.TextDetails2 & vbCrLf & "Modem Model # : " & Me.TextDetails3 &
vbCrLf & "Modem Status : " & Me.TextDetails4 & vbCrLf & "Modem Testing : "
& Me.TextDetails5 & vbCrLf & "Calix Status : " & Me.TextDetails6 & vbCrLf &
"Router Status : " & Me.TextDetails7 & vbCrLf & "----------------------------
----------------------------" & vbCrLf & "Trouble Suggestions: " & Me.
TextDetails8
Forms!GoogleEye!TextSummary1 = Me.TextSummary
Forms!GoogleEye!WebBrowser1.Document.Forms(0).all("ticketDetail").Value =
Forms!GoogleEye!TextSummary1
DoCmd.Close acForm, "frmTicketTemplatesDSL"
End Sub
Add another line of code to the button after all your prior code to populate
the text box on the main form:

Me.Parent!YourTextBox = strTroubleReport

(using the same variable name that Klatuu supplied)

You *may* also need to do a form refresh, I'm foggy this early...
Thanks to both of you!
I used vbCrLf & it properly formatted the lines.
[quoted text clipped - 21 lines]
 
Glad to help any time!

;-)

SusanV

cw via AccessMonster.com said:
Susan, Thank-you again for your help.
That did the trick.
Heres my finished code for the button.

Private Sub Command22_Click()
Dim TextDetails1 As String
Dim TextDetails2 As String
Dim TextDetails3 As String
Dim TextDetails4 As String
Dim TextDetails5 As String
Dim TextDetails6 As String
Dim TextDetails7 As String
Dim TextDetails8 As String
Dim TextSummary As String

Me.TextDetails1 = Nz(Me.ComboBox1.Value)
Me.TextDetails2 = Nz(Me.ComboBox2.Value)
Me.TextDetails3 = Nz(Me.ComboBox3.Value)
Me.TextDetails4 = Nz(Me.ComboBox4.Value)
Me.TextDetails5 = Nz(Me.ComboBox5.Value)
Me.TextDetails6 = Nz(Me.ComboBox6.Value)
Me.TextDetails7 = Nz(Me.ComboBox7.Value)
Me.TextDetails8 = Nz(Me.ComboBox8.Value)

Me.TextSummary = "Trouble Description: " & Me.TextDetails1 & vbCrLf &
"-------
-------------------------------------------------" & vbCrLf &
"Cabling/Setup
: " & Me.TextDetails2 & vbCrLf & "Modem Model # : " & Me.TextDetails3 &
vbCrLf & "Modem Status : " & Me.TextDetails4 & vbCrLf & "Modem Testing
: "
& Me.TextDetails5 & vbCrLf & "Calix Status : " & Me.TextDetails6 &
vbCrLf &
"Router Status : " & Me.TextDetails7 & vbCrLf &
"----------------------------
----------------------------" & vbCrLf & "Trouble Suggestions: " & Me.
TextDetails8
Forms!GoogleEye!TextSummary1 = Me.TextSummary
Forms!GoogleEye!WebBrowser1.Document.Forms(0).all("ticketDetail").Value =
Forms!GoogleEye!TextSummary1
DoCmd.Close acForm, "frmTicketTemplatesDSL"
End Sub
Add another line of code to the button after all your prior code to
populate
the text box on the main form:

Me.Parent!YourTextBox = strTroubleReport

(using the same variable name that Klatuu supplied)

You *may* also need to do a form refresh, I'm foggy this early...
Thanks to both of you!
I used vbCrLf & it properly formatted the lines.
[quoted text clipped - 21 lines]
Thanks in advance for your help,
cw
 
Back
Top