Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Query on Control Source in Userform Textbox
Hi, everybody -
BOY O' BOY --- I continue to improve our agency's Income Calculation Tool with the help of numerous people here. I have a slight problem in one of my VB codings. My particular problem is related to the portion of the code that is seperated and in brackets. I have created a specific userform that includes a number of textboxes where the user enter data that feeds over to the spreadsheet's Data Entry Sheet. The Data Entry Sheet then calculates the family's income and rent whish then feeds over to all of the applicable program letters and worksheets. Within the userform, I have a data entry textbox with the Control Source set to enter the data entered into the textbox to feed into the field Data_Entry_Sheet!B75. What's supposed to happen is: if Data_Entry_Sheet!b75 is populated, via the userform's textbox, Worksheet 8 should be printed out - if the field is empty, Worksheet 8 should not be printed. WHAT IS HAPPENING --- everytime I run the code, even when Data_Entry_Sheet!b75 is empty, the worksheet prints out!!! Sorry for the extended query. I'm hoping one of the experts here can give me a clue why this is happening and how I can fix the code. CODE BELOW: Sub PrintTTPWorksheet() 'Print S8 Annuals and Interims' PaperWarning = ktMsgBox("PRIOR TO PRINTING ANY WORKSHEETS:" & vbCrLf & "Please verify whether any houshold members qualify" & vbCrLf & "for the Earned Income Disregard. If you have verified all" & vbCrLf & "household members, press YES to continue the printing" & vbCrLf & "process." & vbCrLf & "If you need to enter additional earned income disregard" & vbCrLf & "data, press NO and enter the data." _ , vbYesNo + vbCritical, "REMEMBER TO CHECK ALL HOUSEHOLD MEMBERS FOR FOR MEID" _ , PromptColor:=vbRed _ , BackColor:=&HFFCC00 _ , Chime:=True _ , FontName:="TAHOMA" _ , FontSize:=20 _ , WaitSecond:=0 _ , ChimeColor:=&H808000) If PaperWarning = 6 Then [A1].Select Sheet3.Select Sheet3.PrintOut Sheet3.Select Sheet3.PrintOut Sheet1.Select Sheet1.PrintOut Sheet4.Select Sheet4.PrintOut Sheet14.Activate With Sheet14 ..Unprotect "led52not" ..Shapes("Text Box 1").Select Selection.Characters.Text = "P" ..Shapes("Text Box 2").Select Selection.Characters.Text = "" ..Shapes("Text Box 3").Select Selection.Characters.Text = "" ..Shapes("Text Box 4").Select Selection.Characters.Text = "" ..PrintOut ..Shapes("Text Box 1").Select Selection.Characters.Text = "" ..Shapes("Text Box 2").Select Selection.Characters.Text = "P" ..PrintOut ..Shapes("Text Box 2").Select Selection.Characters.Text = "" ..Shapes("Text Box 3").Select Selection.Characters.Text = "P" ..PrintOut ..Shapes("Text Box 3").Select Selection.Characters.Text = "" ..Shapes("Text Box 4").Select Selection.Characters.Text = "P" ..PrintOut ..Shapes("Text Box 4").Select Selection.Characters.Text = "" ..Range("A12").Select Sheet2.Select [[[If ("Data_Entry_Sheet!B75") "" Then Sheet8.PrintOut]]] PaperWarning = ktMsgBox("Insert your envelopes now. Click YES to print your envelopes." & vbCrLf & "Otherwise, click NO to Cancel." _ , vbYesNo + vbCritical, "PREPARING TO PRINT YOUR ENVELOPES FOR SECTION 8 AMENDMENTS" _ , PromptColor:=vbRed _ , BackColor:=&HFFCC00 _ , Chime:=False _ , FontName:="TAHOMA" _ , FontSize:=16 _ , WaitSecond:=0 _ , ChimeColor:=&H808000) If PaperWarning = 6 Then Sheet24.PrintOut Sheet25.PrintOut PaperWarning = ktMsgBox("If this is a MOVE, check MLS to see if there is already an Alternate Address entered. Click YES if there is no Alternate Address to remove. Otherwise, click NO and remove the Alternate Address." _ , vbYesNo + vbCritical, "CHECK MLS FOR AN ALTERNATE ADDRESS" _ , PromptColor:=vbRed _ , BackColor:=&HFFCC00 _ , Chime:=True _ , FontName:="TAHOMA" _ , FontSize:=16 _ , WaitSecond:=10 _ , ChimeColor:=&H808000) If PaperWarning = 6 Then [A1].Select ..Protect "led52not" End If End If End If End With End If End Sub THANKS FOR ALL THE HELP!!!!! Golf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Syntax for control source in combo box control | Excel Discussion (Misc queries) | |||
userform textbox | Excel Worksheet Functions | |||
Autofill userform textbox | Excel Programming | |||
hide a textbox on a userform? | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |