Hi.
What am I doing wrong. I can pass the strings to Form2 if I refer to the strings as Form1.string. But Form2 will also need to process data from other forms, e.g. Form3.
Form2 has a winsock control to send the data to an E-mail address.
Form1: optSelect is the string I'm trying to pass without the Form1. prefix. It's the description of which option button was selected.
Code:Public txtTo As String Public txtMsg As String Public txtSubject As String Public txtCC As String Public optSelect As String Sub cmdSend_Click(Index As Integer) If optSelect = "" Then MsgBox ("You must select a discrepancy type.") Exit Sub End If Form2.Show End Sub Sub optDiscr_Click(Index As Integer) If optDiscr(0).Value = True Then optSelect = "Discrepancy Report - Transfer" ElseIf optDiscr(1).Value = True Then optSelect = "Discrepancy Report - Inventory Level" ElseIf optDiscr(2).Value = True Then optSelect = "Discrepancy Report - Replenishment" ElseIf optDiscr(3).Value = True Then optSelect = "Discrepancy Report - Core Returns" ElseIf optDiscr(4).Value = True Then optSelect = "Discrepancy Report - New Defective" ElseIf optDiscr(5).Value = True Then optSelect = "Discrepancy Report - Other" End If End Sub Sub txtWhse_Change() txtWhse.Text = UCase(txtWhse.Text) End Sub
Form2: All the strings prefaced with Form1. come through ok. The string optSelect doesn't. It shows "Empty" when running in Debug.
Again, as alwaysCode:Sub Form_Load() txtTo = "[email protected]" txtMsg = "Whse " & Form1.txtWhse & vbCrLf & _ "Name " & Form1.txtName & vbCrLf & vbCrLf & _ "Item " & Form1.txtPart & vbCrLf & vbCrLf & _ "Discrepancy" & vbCrLf & Form1.txtDisc txtSubject = optSelect Text1.Text = txtSubject & vbCrLf & _ "To: " & txtTo & vbCrLf & _ txtMsg End Sub
Thanks,
Al.
------------------
A computer is a tool, not a toy.
<A HREF="mailto:[email protected]
[email protected]">[email protected]
[email protected]</A>




Reply With Quote