LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Scrutinizing Controls on Form for Certain Value


Excel 2003 w/Visual Basic 6.3

I have a form with several types of controls; labels, command buttons
check boxes and text boxes.

The text boxes take user input in the form of numbers.
All text boxes have names of the form "txtNAME".

e.g. txtBUN, txtTRIG, txtAST, etc.

The user might then assign a number to certain text boxes.

e.g. txtBUN = 7, txtTRIG = 15 , txtAST = 21, etc.

What I would like to do is query the form to check if any of thes
numbers match a value that is derived previously, then procee
accordingly.

What I have below DOES NOT work and I can't figure out a way around it
I think it has to do with TextBox.Value which I'm not sure is viable.
Any suggestions?


Code
-------------------
Dim TextBox As Control

For Each TextBox In frmReagInv.Controls
If Left(TextBox.Name, 3) = "txt" Then
If TextBox.Value = Z Then
ChemName(K) = Mid(TextBox.Name, 4)
End If
End If
Next TextBo
-------------------

--
scantor14
-----------------------------------------------------------------------
scantor145's Profile: http://www.excelforum.com/member.php...fo&userid=1476
View this thread: http://www.excelforum.com/showthread.php?threadid=38935

 
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
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Controls on form disappear jashburn13 Excel Programming 0 June 27th 05 07:36 AM
Form controls Sheldon Excel Programming 2 October 22nd 04 01:20 PM
about more controls of a form EXCEL$B!!(BNEWS Excel Programming 0 October 1st 04 08:59 AM
group name for form controls Edwin Merced Excel Programming 2 November 29th 03 12:45 AM


All times are GMT +1. The time now is 02:06 PM.

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

About Us

"It's about Microsoft Excel"