Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-01-31 : 14:09:25
|
Here's my code, but it's not getting caught:If Len(Trim(txtASBRes.Text)) > 0 And InStr(txtASBRes.Text, "|") = 0 Then'Means there are characters for the Resource code' and no pipecleaner = didn't use ddl for namelblResCodeWarn.Visible = TruelblResCodeWarn.Text = "* Use list!"Exit SubEnd IfIf the user just types something in and doesn't use the autosuggest text box, then I want to tell them via a warning they need to use the values from the dropdown list. The above code isn't getting caught though.Any suggestions are welcome!Thanks! |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-31 : 14:15:23
|
We don't know in which event this code is run...Peter LarssonHelsingborg, Sweden |
|
|
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-01-31 : 14:29:58
|
It's my datagrid update command.If the user tries to update a name, and doesn't use the autosuggest text box's dropdown list, then I wanna exit the sub and display the error message. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-31 : 14:36:47
|
And txtASBRes is the autosuggest textbox?Peter LarssonHelsingborg, Sweden |
|
|
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-01-31 : 14:41:51
|
yes |
|
|
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-01-31 : 15:58:12
|
Peso,Thanks for your patience and help!I wasn't handling my control structure correctly.If there was no "|", I wasn't handling it properly when I ran a database query to make sure the user didn't select a name, then try to edit it on the fly.So, I needed to say if there's no "|" and the len() > 0, then "NO WAY" & exit the subelseif there is a "|" and the len() > 0, then do the db check.Sorry for the confusion! |
|
|
|
|
|
|
|