|
-
Jan 6th, 2007, 11:25 PM
#1
Thread Starter
New Member
[2005] Advice on best method for null checking multiple items depending on the value
Hello everyone,
I am new to this forum, and glad I found this place as I have been browsing the forums and found some very interesting topics. I do have a question on some coding that I cannot figure out no matter how many times I sit and think about it.
I am using Visual Basic 2005 - Express Edition. I learned Visual Basic (before .net) along time ago, but never completed the full course. I know I need to finish it, and would like to learning more advanced .NET stuff.
Brief over view of my application: My Application is just a small tool bar for work that will hold our most used applications so that we quickly access them instead of having to search all over the place for them. There is an 'Application Administration' dialog which has five tabs (One for each application button). The user can enable or disable each application button as they see the need to.
What I need is to check each tab to see if:
A) chkEnableApp1.checked = True & if so, check to see if:
a.) txtApp1Name.text = "", if so: prompt with message box
b.) txtApp1Location.text = "", if so: prompt with message box
if a.) & b.) are not blank, then check to see on the same tab if chkEnableSApp1.checked = true & if so, check to see if:
a.) txtSapp1Name.Text = "", if so: prompt with message box
b.) txtSapp1Location.text = "", if so: prompt with message box
If none of those boxes are blank, then check next tab, until all five application tabs have been checked. Once they are error free, call SBAppLauncherSaveSettings.
Sorry, I hope this all makes sense to everyone.
I have tried searching google multiple times, and this forum a few times.
This seems like it might help, http://www.vbforums.com/showthread.p...iple+textboxes
but I am not sure.
I also tried using:
VB Code:
if chkEnableApp1.Checked = True then
if txtApp1Name.Text = "" Then
txtApp1Name.Focus()
MsgBox("Error. Application one is not named.")
elseif txtApp1Location.Text = "" Then
txtApp1Location.Focus()
MsgBox("Error. Application one has no location.")
end if
elseif chkEnableSApp1.Checked = True then
if txtSapp1Name.Text = "' then
txtSApp1Name.focus()
MsgBox("Error. Sub Application one is not named.")
elseif txtSApp1Location.Text = "" then
txtSapp1Location.focus()
MsgBox("Error. Sub Application one has no location.")
end if
elseif .... etc..
It never goes past the first inner if then else statement because the outer if then else statement is still true, so no need to continue to check and see about the rest. Maybe I am just not thinking fully today. I hope someone can shed some light on this and point me in the right direction.
Thanks very much,
Kei
Last edited by kurashima; Jan 7th, 2007 at 02:47 PM.
Reason: Edited Subject for hopefully a responce. Old subject seemed to basic for what I am asking.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|