Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Conditional checks in Userform

I have Leave posting userform that updates leaves of employees.It has
Combobox1--List of employees
Combobox2--List Leave Names(only three values viz;CL,PL,SL)
TextBox1--Leave Begin Date
TextBox2--Leave End Date
TextBox3--CL balance days
TextBox4--PL balance days
TextBox5--SL balance days
CommandButton1--UpdateLeaveSheet
When selected a Employee name from ComboBox1 List,leave balances of selected
employee are fetched from LeaveSheet and displayed in TextBoxes 3,4 and 5.
I need code to check : 1.If TextBox 3,4,5 values are zero then promt msg"No
leave",disable commandButton1,exit sub.
2.if comboBox2 value "CL" and Textbox3 value is zero,msg"CL exhausted",
disable CommandButton1,exit sub.
3.if comboBox2 value "PL" and Textbox4 value is zero,msg"PL exhausted",
disable CommandButton1,exit sub.
4..if comboBox2 value "SL" and Textbox5 value is zero,msg"SL exhausted",
disable CommandButton1,exit sub.
5.if comboBox2 value "CL" and (Textbox2 value-TextBox1 value)+1 is greater
than TextBox3 value,msg"insufficient CL ,re-enter Leave end date ",clear and
select TextBox2.
6.if comboBox2 value "PL" and (Textbox2 value-TextBox1 value)+1 is greater
than TextBox4 value,msg"insufficient PL ,re-enter Leave end date ",clear and
select TextBox2.
7..if comboBox2 value "SL" and (Textbox2 value-TextBox1 value)+1 is greater
than TextBox5 value,msg"insufficient SL ,re-enter Leave end date ",clear and
select TextBox2.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200905/1

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup that checks against two values runsrealfast Excel Worksheet Functions 4 February 1st 08 02:43 AM
Checks whether a value is text or number robertc Excel Worksheet Functions 1 February 23rd 07 01:39 PM
Checks whether a value is text or number john Excel Worksheet Functions 0 February 23rd 07 01:35 PM
Checks whether a value is text or number robertc Excel Worksheet Functions 0 February 23rd 07 01:26 PM
Different colored checks?? Ltat42a Excel Discussion (Misc queries) 0 August 2nd 06 07:35 PM


All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"