OscarAlberto
Programmer
I am using a Standard Module, Public defined variable, named SourceID, to pass its contents from a UserForm to another UserForm, but it is not working. The code in the first UserForm is the following:
Private Sub OKPrompt_Click()
Call ObjectVarDeclar
Dim Counter As Integer
Application.ScreenUpdating = False
Financing.Activate
.....(code)......
If CheckBox16 = True Then
SourceID = 48
ElseIf CheckBox17 = True Then
SourceID = 49
ElseIf CheckBox18 = True Then
SourceID = 50
End If
The receiving UserForm does not recognize the value of SourceID, assigning a ZERO value to it. The code in the receiving UserForm is the following:
Private Sub UserForm_Initialize()
Call ObjectVarDeclar
UnevenRepayment.BackColor = RGB(0, 128, 64)
If SourceID = 48 Then
TextBox14.Text = "Loan Term Facility #1"
TextBox15.Text = Financing.Range("EquityDrawings"
.Offset(4, 13)
HorizontalPosition = 13
ColumnNumber = 17
ElseIf SourceID = 49 Then
TextBox14.Text = "Loan Term Facility #2"
TextBox15.Text = Financing.Range("EquityDrawings"
.Offset(4, 14)
HorizontalPosition = 14
ColumnNumber = 18
ElseIf SourceID = 50 Then
TextBox14.Text = "Loan Term Facility #3"
TextBox15.Text = Financing.Range("EquityDrawings"
.Offset(4, 15)
HorizontalPosition = 15
ColumnNumber = 19
End If
If Financing.Range("EquityDrawings"
.Offset(4, HorizontalPosition) < 1 Then
TextBox1.BackColor = RGB(0, 0, 255)
TextBox1.TabStop = False
TextBox2.BackColor = RGB(0, 0, 255)
TextBox2.TabStop = False
TextBox3.BackColor = RGB(0, 0, 255)
TextBox3.TabStop = False
TextBox4.BackColor = RGB(0, 0, 255)
TextBox4.TabStop = False
TextBox5.BackColor = RGB(0, 0, 255)
TextBox5.TabStop = False
TextBox6.BackColor = RGB(0, 0, 255)
TextBox6.TabStop = False
TextBox7.BackColor = RGB(0, 0, 255)
TextBox7.TabStop = False
TextBox8.BackColor = RGB(0, 0, 255)
TextBox8.TabStop = False
TextBox9.BackColor = RGB(0, 0, 255)
TextBox9.TabStop = False
TextBox10.BackColor = RGB(0, 0, 255)
TextBox10.TabStop = False
TextBox11.BackColor = RGB(0, 0, 255)
TextBox11.TabStop = False
TextBox12.BackColor = RGB(0, 0, 255)
TextBox12.TabStop = False
TextBox13.BackColor = RGB(0, 0, 255)
TextBox13.TabStop = False
I know the value of SourceID is ZERO because all textboxes appear blue, but the value of Financing.Range("EquityDrawings"
.Offset(4, HorizontalPosition) is 10, so only the last three textboxes should appear blue.
Thanks in advance.
Oscar Alberto.
Private Sub OKPrompt_Click()
Call ObjectVarDeclar
Dim Counter As Integer
Application.ScreenUpdating = False
Financing.Activate
.....(code)......
If CheckBox16 = True Then
SourceID = 48
ElseIf CheckBox17 = True Then
SourceID = 49
ElseIf CheckBox18 = True Then
SourceID = 50
End If
The receiving UserForm does not recognize the value of SourceID, assigning a ZERO value to it. The code in the receiving UserForm is the following:
Private Sub UserForm_Initialize()
Call ObjectVarDeclar
UnevenRepayment.BackColor = RGB(0, 128, 64)
If SourceID = 48 Then
TextBox14.Text = "Loan Term Facility #1"
TextBox15.Text = Financing.Range("EquityDrawings"
HorizontalPosition = 13
ColumnNumber = 17
ElseIf SourceID = 49 Then
TextBox14.Text = "Loan Term Facility #2"
TextBox15.Text = Financing.Range("EquityDrawings"
HorizontalPosition = 14
ColumnNumber = 18
ElseIf SourceID = 50 Then
TextBox14.Text = "Loan Term Facility #3"
TextBox15.Text = Financing.Range("EquityDrawings"
HorizontalPosition = 15
ColumnNumber = 19
End If
If Financing.Range("EquityDrawings"
TextBox1.BackColor = RGB(0, 0, 255)
TextBox1.TabStop = False
TextBox2.BackColor = RGB(0, 0, 255)
TextBox2.TabStop = False
TextBox3.BackColor = RGB(0, 0, 255)
TextBox3.TabStop = False
TextBox4.BackColor = RGB(0, 0, 255)
TextBox4.TabStop = False
TextBox5.BackColor = RGB(0, 0, 255)
TextBox5.TabStop = False
TextBox6.BackColor = RGB(0, 0, 255)
TextBox6.TabStop = False
TextBox7.BackColor = RGB(0, 0, 255)
TextBox7.TabStop = False
TextBox8.BackColor = RGB(0, 0, 255)
TextBox8.TabStop = False
TextBox9.BackColor = RGB(0, 0, 255)
TextBox9.TabStop = False
TextBox10.BackColor = RGB(0, 0, 255)
TextBox10.TabStop = False
TextBox11.BackColor = RGB(0, 0, 255)
TextBox11.TabStop = False
TextBox12.BackColor = RGB(0, 0, 255)
TextBox12.TabStop = False
TextBox13.BackColor = RGB(0, 0, 255)
TextBox13.TabStop = False
I know the value of SourceID is ZERO because all textboxes appear blue, but the value of Financing.Range("EquityDrawings"
Thanks in advance.
Oscar Alberto.