chungtinhlak
12-10-2008, 11:42 AM
I have a form with 18 different textboxes, at initialize, these textbox have a default value in them. i ahve a clear button to clear all these but some how when i hit find, all the default date form initializing stage of the form still is the value of my textbox, all the keyword that i entered are not being taken. Can someone help me.
thanks
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdclear_Click()
keywordlookup.TextBox1.Value = ""
keywordlookup.TextBox2.Value = ""
keywordlookup.TextBox3.Value = ""
keywordlookup.TextBox4.Value = ""
keywordlookup.TextBox5.Value = ""
keywordlookup.TextBox6.Value = ""
keywordlookup.TextBox7.Value = ""
keywordlookup.TextBox8.Value = ""
keywordlookup.TextBox9.Value = ""
keywordlookup.TextBox10.Value = ""
keywordlookup.TextBox11.Value = ""
keywordlookup.TextBox12.Value = ""
keywordlookup.TextBox13.Value = ""
keywordlookup.TextBox14.Value = ""
keywordlookup.TextBox15.Value = ""
keywordlookup.TextBox16.Value = ""
keywordlookup.TextBox17.Value = ""
keywordlookup.TextBox18.Value = ""
End Sub
Private Sub cmdfind_Click()
Unload Me
If keywordlookup.TextBox1.Value = "" Then
keywordlookup.TextBox1.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox2.Value = "" Then
keywordlookup.TextBox2.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox3.Value = "" Then
keywordlookup.TextBox3.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox4.Value = "" Then
keywordlookup.TextBox4.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox5.Value = "" Then
keywordlookup.TextBox5.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox6.Value = "" Then
keywordlookup.TextBox6.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox7.Value = "" Then
keywordlookup.TextBox7.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox8.Value = "" Then
keywordlookup.TextBox8.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox9.Value = "" Then
keywordlookup.TextBox9.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox10.Value = "" Then
keywordlookup.TextBox10.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox11.Value = "" Then
keywordlookup.TextBox11.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox12.Value = "" Then
keywordlookup.TextBox12.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox13.Value = "" Then
keywordlookup.TextBox13.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox14.Value = "" Then
keywordlookup.TextBox14.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox15.Value = "" Then
keywordlookup.TextBox15.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox16.Value = "" Then
keywordlookup.TextBox16.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox17.Value = "" Then
keywordlookup.TextBox17.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox18.Value = "" Then
keywordlookup.TextBox18.Value = "No Keyword To Search"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''
'''''''''''''''''''''''''''''
Range("AT:BN").Select
Selection.ClearContents
''''''''''''''''''''''''''''
Range("AW1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox1
Range("AX1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox2
Range("AY1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox3
Range("AZ1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox4
Range("BA1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox5
Range("BB1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox6
Range("BC1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox7
Range("BD1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox8
Range("BE1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox9
Range("BF1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox10
Range("BG1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox11
Range("BH1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox12
Range("BI1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox13
Range("BJ1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox14
Range("BK1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox15
Range("BL1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox16
Range("BM1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox17
Range("BN1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox18
Application.Run "workbook_setup"
Application.Run "Keyword_lookup"
End If
End Sub
Private Sub UserForm_Initialize()
keywordlookup.TextBox1.Value = "epd written"
keywordlookup.TextBox2.Value = "epd required"
keywordlookup.TextBox3.Value = "Need epd"
keywordlookup.TextBox4.Value = "required epd"
keywordlookup.TextBox5.Value = "epd needed"
keywordlookup.TextBox6.Value = "epd need"
keywordlookup.TextBox7.Value = "epd request"
keywordlookup.TextBox8.Value = "request epd"
keywordlookup.TextBox9.Value = "needs epd"
keywordlookup.TextBox10.Value = "need rev"
keywordlookup.TextBox11.Value = "epd for"
keywordlookup.TextBox12.Value = "EPD Initiation"
keywordlookup.TextBox13.Value = "EPD initiated"
keywordlookup.TextBox14.Value = "to initiated"
keywordlookup.TextBox15.Value = "please initiate"
keywordlookup.TextBox16.Value = "initiate epd"
keywordlookup.TextBox17.Value = "initiate pick-up"
keywordlookup.TextBox18.Value = ""
End Sub
thanks
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdclear_Click()
keywordlookup.TextBox1.Value = ""
keywordlookup.TextBox2.Value = ""
keywordlookup.TextBox3.Value = ""
keywordlookup.TextBox4.Value = ""
keywordlookup.TextBox5.Value = ""
keywordlookup.TextBox6.Value = ""
keywordlookup.TextBox7.Value = ""
keywordlookup.TextBox8.Value = ""
keywordlookup.TextBox9.Value = ""
keywordlookup.TextBox10.Value = ""
keywordlookup.TextBox11.Value = ""
keywordlookup.TextBox12.Value = ""
keywordlookup.TextBox13.Value = ""
keywordlookup.TextBox14.Value = ""
keywordlookup.TextBox15.Value = ""
keywordlookup.TextBox16.Value = ""
keywordlookup.TextBox17.Value = ""
keywordlookup.TextBox18.Value = ""
End Sub
Private Sub cmdfind_Click()
Unload Me
If keywordlookup.TextBox1.Value = "" Then
keywordlookup.TextBox1.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox2.Value = "" Then
keywordlookup.TextBox2.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox3.Value = "" Then
keywordlookup.TextBox3.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox4.Value = "" Then
keywordlookup.TextBox4.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox5.Value = "" Then
keywordlookup.TextBox5.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox6.Value = "" Then
keywordlookup.TextBox6.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox7.Value = "" Then
keywordlookup.TextBox7.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox8.Value = "" Then
keywordlookup.TextBox8.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox9.Value = "" Then
keywordlookup.TextBox9.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox10.Value = "" Then
keywordlookup.TextBox10.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox11.Value = "" Then
keywordlookup.TextBox11.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox12.Value = "" Then
keywordlookup.TextBox12.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox13.Value = "" Then
keywordlookup.TextBox13.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox14.Value = "" Then
keywordlookup.TextBox14.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox15.Value = "" Then
keywordlookup.TextBox15.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox16.Value = "" Then
keywordlookup.TextBox16.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox17.Value = "" Then
keywordlookup.TextBox17.Value = "No Keyword To Search"
End If
If keywordlookup.TextBox18.Value = "" Then
keywordlookup.TextBox18.Value = "No Keyword To Search"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''
'''''''''''''''''''''''''''''
Range("AT:BN").Select
Selection.ClearContents
''''''''''''''''''''''''''''
Range("AW1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox1
Range("AX1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox2
Range("AY1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox3
Range("AZ1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox4
Range("BA1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox5
Range("BB1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox6
Range("BC1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox7
Range("BD1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox8
Range("BE1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox9
Range("BF1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox10
Range("BG1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox11
Range("BH1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox12
Range("BI1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox13
Range("BJ1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox14
Range("BK1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox15
Range("BL1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox16
Range("BM1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox17
Range("BN1").Select
ActiveCell.FormulaR1C1 = keywordlookup.TextBox18
Application.Run "workbook_setup"
Application.Run "Keyword_lookup"
End If
End Sub
Private Sub UserForm_Initialize()
keywordlookup.TextBox1.Value = "epd written"
keywordlookup.TextBox2.Value = "epd required"
keywordlookup.TextBox3.Value = "Need epd"
keywordlookup.TextBox4.Value = "required epd"
keywordlookup.TextBox5.Value = "epd needed"
keywordlookup.TextBox6.Value = "epd need"
keywordlookup.TextBox7.Value = "epd request"
keywordlookup.TextBox8.Value = "request epd"
keywordlookup.TextBox9.Value = "needs epd"
keywordlookup.TextBox10.Value = "need rev"
keywordlookup.TextBox11.Value = "epd for"
keywordlookup.TextBox12.Value = "EPD Initiation"
keywordlookup.TextBox13.Value = "EPD initiated"
keywordlookup.TextBox14.Value = "to initiated"
keywordlookup.TextBox15.Value = "please initiate"
keywordlookup.TextBox16.Value = "initiate epd"
keywordlookup.TextBox17.Value = "initiate pick-up"
keywordlookup.TextBox18.Value = ""
End Sub