|
-
Mar 21st, 2000, 06:22 PM
#1
Thread Starter
New Member
I want to perform three validations
on a particular field.the field is of
textbox type.Fieldname - code-primary key
the 3 validations are
1)cannot leave it blank
2)duplication check
3)only enter in this format 'D001'
cannot get this done
Problem-if one works another stops working
and so on
soln- i want all three should work together
NB-i have used lostfocus of textbox.
Iteration being if then...else
tried with select case,elseif,do while...loop
but did not work
-
Mar 21st, 2000, 08:01 PM
#2
Lively Member
Hi,
I didn't know exactly what you mean with duplication check ...
However, for the other two validations I have a suggestion
hope this helps 
Nina
___________________________________________
Code:
Private Sub Text1_Validate(KeepFocus As Boolean)
If Text1 = "" Then
KeepFocus = True
MsgBox "...", , "Invalid Entry in Textbox"
Exit Sub
End If
If Not Text1 Like "[D]###" Then
KeepFocus = True
MsgBox "Doesn't match required pattern", , "Invalid Entry in Textbox"
Exit Sub
End If
'+ code for 3rd validation
End Sub
[Edited by Nina on 03-22-2000 at 08:17 AM]
-
Mar 21st, 2000, 11:59 PM
#3
Hyperactive Member
Could you use a combobox? You can then do the duplicate validation against the members of the list.
A valid entry would then be add to the list so duplicates of THAT could not be entered.

Dan
-
Mar 22nd, 2000, 12:09 AM
#4
Hyperactive Member
If this is an incremental value that is used just as the key, could you determine what the next key value should be and automatically populate (and disable) the control?
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
|