Sunday, September 18, 2016

change a combobox value based ona textbox value

change a combobox value based ona textbox value

I have a combobox and few textboxes on a vba form
if the value in the result textbox is "0.00" then I want the combobox to show "Closed", if the values is a negative value then it has to show "Partial"
both "Closed" and "partial" are in the Combobox range.
thank you

Keys to the Problem change a combobox value based ona textbox value

Download Error Fixer (Free)

Because you are already using VBA code to calculate the TextBox value then I would include it in the code like the example below.
Note that I have used a work around to get the TextBox to format to 0.00 because I cannot get it to format unless I do it on
the Exit event.
This doesn't alter the code any but I am interested in the method you are using to get the TextBox to format.
For the example I have used a Command Button to perform a dummy calculation for testing purposes.
Private Sub CommandButton1_Click()
    TextBox1.Value = Val(Me.TextBox2.Value) + Val(Me.TextBox3.Value)
    TextBox1.SetFocus   'Set focus to TextBox so next line Exits from correct TextBox
    TextBox2.SetFocus   'Exit TextBox fires the Exit Event code
    Select Case Val(TextBox1.Value)
        Case 0
            ComboBox1.Value = "Closed"
        Case Is < 0
            ComboBox1.Value = "Partial"
        Case Else       'The Else code is optional
            ComboBox1.Value = ""    'Optional
    End Select
   
End Sub

'Following code in the Exit Event is the only way I can set the TextBox Number format
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    TextBox1.Value = Format(TextBox1.Value, "0.00")
End Sub

To install drivers and other optional updates

  1. To install optional updates, you need to review and then select them from the list of updates that Windows finds for your computer. Optional updates are not installed automatically.
  2. Open Windows Update by clicking the Start button Picture of the Start button, clicking All Programs, and then clicking Windows Update.
  3. In the left pane, click Check for updates, and then wait while Windows looks for the latest updates for your computer.
  4. If any updates are found, click View available updates.
  5. Select the optional updates that you want, and then click Install. Administrator permission required If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

Recommended Method to Fix the Problem: change a combobox value based ona textbox value:

How to Fix change a combobox value based ona textbox value with SmartPCFixer?

1. You can Download Error Fixer here. Install it on your computer. When you open it, it will perform a scan.

2. After the scan is done, you can see the errors and problems which need to be repaired.

3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been removed.


Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.8.0.43.0,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: Cisco VPN using XP Mode in Windows 7 Professional [Anwsered],Troubleshoot:changing dvd region 1 to region 2 being unsuccessful,Fast Solution to Problem: Cell editing problem,How Can I Fix - cant start itunes because libicuin.dill is missing from pc?,Troubleshooting:CD\/DVD, NOT WORKING; CAN'T PAY OR INSTALL PROGRMAS, WIN 7,Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver

No comments:

Post a Comment