Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs?
Error: Mine or VSs? Error: Mine or VSs?
Error: Mine or VSs?
Go Back  Xtreme Visual Basic Talk > > > Error: Mine or VSs?


Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2015, 04:53 PM
JeremyBenson11 JeremyBenson11 is offline
Regular
 
Join Date: Dec 2013
Posts: 50
Default Error: Mine or VSs?


hmm,

I'm working with some simple logic. I'm trying to put a string in a string list based on an if statement. I've been messing with if statements get my head around them not firing, so I wrote this out.

Code:
If room.FirstVisitDescription = "cool" Then

            MsgBox("WOW.")

        End If
This is as simple as it gets. The thing is if I write cool in the rich text box this doesn't fire..

This is the statement I'm really trying to fire.

Code:
  If room.HasFirstVisit = True And room.FirstVisitDescription = "" Then

            MsgBox("FIRED")
            canAddRoom = False
            errorList.Add("Room has first visit checked, but no description was given for first visit.")

        End If
It doesn't fire even if the check box is checked and the description box is empty.

If I write this:

Code:
  If room.HasFirstVisit = True Or room.FirstVisitDescription = "" Then

            MsgBox("FIRED")
            canAddRoom = False
            errorList.Add("Room has first visit checked, but no description was given for first visit.")

        End If
It will fire, but only based on the checkbox. If it's checked it will fire.

I know there's a string in FirstVisitDescription because I've MsgBoxed it...

What should I be looking for to fix this error?

Thanks for your time,
Jeremy.
Reply With Quote
  #2  
Old 02-24-2015, 06:12 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default Hmm

What do you meen it does not fire? Have you gone through the code in debug mode and seen what the values of the "room" Object is when it comes to it? Also, you say it doesn't fire even if the checkbox is checked and the textbox is empty. Well, that does not automatically transfer the information to the "room" Object. Where is the code where you move the value from the textbox/checkbox into the Object? Are you sure you are filling the description correctly? Show us some more code...
Reply With Quote
  #3  
Old 02-24-2015, 07:10 AM
TheRealTinTin's Avatar
TheRealTinTin TheRealTinTin is offline
Junior Contributor
 
Join Date: Nov 2008
Location: Glasgow, UK
Posts: 383
Default

Where is the code placed? when do you want it to check the scenario - when the textbox's contents are changed? If so, it needs to reside in the 'TextChanged' event of the textbox.
__________________
Artificial Intelligence is no match for natural stupidity
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs? Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs? Error: Mine or VSs?
Error: Mine or VSs?
Error: Mine or VSs?
 
Error: Mine or VSs?
Error: Mine or VSs?
 
-->