ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,699
- Office Version
- 2007
- Platform
- Windows
Hi,
I would like to open the userform & see in TextBox5 NO NOTES FOR THIS CUSTOMER without me having to type it.
I have tried like below but i get an error message, run time error 424 object required
So i have also supplied my forms code should it need to go there.
I would like to open the userform & see in TextBox5 NO NOTES FOR THIS CUSTOMER without me having to type it.
I have tried like below but i get an error message, run time error 424 object required
Code:
Private Sub Image1_Click()DatabaseInput.Show
TextBox5.Value = "NO NOTES FOR THIS CUSTOMER"
End Sub
So i have also supplied my forms code should it need to go there.
Code:
Private Sub CommandButton1_Click()
With Sheets("DATABASE")
If Not Application.CountIf(.Columns(16), Me.TextBox4.Text) > 0 Then
Rows("6:6").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A6").Select
Range("A6:Q6").Borders.LineStyle = xlContinuous
Range("A6:Q6").Borders.Weight = xlThin
Range("A6:Q6").Interior.ColorIndex = 6
Range("M6") = Date
Range("$Q$6").Value = "'NO NOTES FOR THIS CUSTOMER"
Range("$Q$6").HorizontalAlignment = xlCenter
.Range("A6").Value = Me.TextBox1.Text
.Range("B6").Value = Me.ComboBox1.Text
.Range("C6").Value = Me.ComboBox2.Text
.Range("D6").Value = Me.ComboBox3.Text
.Range("E6").Value = Me.ComboBox4.Text
.Range("F6").Value = Me.ComboBox5.Text
.Range("G6").Value = Me.ComboBox6.Text
.Range("H6").Value = Me.ComboBox7.Text
.Range("I6").Value = Me.ComboBox8.Text
.Range("J6").Value = Me.ComboBox9.Text
.Range("K6").Value = Me.ComboBox10.Text
.Range("L6").Value = Me.ComboBox11.Text
.Range("M6").Value = Me.TextBox2.Text
.Range("N6").Value = Me.ComboBox12.Text
.Range("O6").Value = Me.TextBox3.Text
.Range("P6").Value = Me.TextBox4.Text
.Range("Q6").Value = Me.TextBox5.Text
Else
With Me.TextBox4
MsgBox .Text & Chr(10) & "This Invoice Number Exists", 16, "Duplicate Invoice Number"
.Value = "": .SetFocus
End With
Exit Sub
End If
End With
Dim ctrl As MSForms.Control
For Each ctrl In Me.Controls
Select Case True
Case TypeOf ctrl Is MSForms.TextBox
ctrl.Value = ""
Case TypeOf ctrl Is MSForms.combobox
ctrl.Value = ""
End Select
Next ctrl
MsgBox "Database Has Been Updated", vbInformation
TextBox2.Value = Now
TextBox2 = Format(TextBox2.Value, "dd/mm/yyyy")
TextBox1.SetFocus
TextBox5.Value = "NO NOTES FOR THIS CUSTOMER"
End Sub