Tabing through forms

Little_Man22

Registered User.
Local time
Today, 04:02
Joined
Jun 23, 2001
Messages
118
How do I set up a form so that there is some type of forced field checking wherein the user can't tab to field b until field a is completed?



[This message has been edited by Little_Man22 (edited 03-09-2002).]
 
Probably best to check the fields in the Forms Before Update event when the user gets ready to move to another record. The user can use the mouse to skip fields in your form and your field code will not get triggered.
 
I want to have it though so that the user has to start in the first field and can't enter another field until that one is finished...how would I do something like that (i.e. what would there vb code look like and where would it go?)?

-Ryan.
 
I haven't given this much thought but I would imagine that since the mouse is the unknown here that you would have to put code in all the fields on the form so when the field is entered that you check all the other fields to find ones that are null and then send the user there. I can't think of any way to turn off the mouse so they must use the tab key to navigate your form. Hopefully someone else has a clever way to implement what you want to do.
 
On my database a field is not enabled until you enter the data in the previous field this seems to work pretty well
 
That's actually a really cool idea...I'll try it out
smile.gif


Thanks.
 
Hi,

Using the code below in the OnExit event together with establishing a default for the field works pretty well - it ensures 2 things:
1) that a user cannot skip entering required info.
2) that they enter the correct info.


Private Sub yourfieldname_Exit(Cancel As Integer)
If IsNull([yourfieldname]) Then
MsgBox "1st line your wrong response message here" & vbNewLine & _
"2nd line your wrong response message here..."
[your'different'fieldname].SetFocus
[yourfieldname].SetFocus
End If
End Sub


Hope this helps,

Michael
 
That last code won't make the user enter the fields in any particular order though will it? I need something like Geoff suggested where the user CANNOT skip fields at all (whether it's using the mouse or tabbing).

The other option is to write a function that checks all of the fields when the form exits. I have a function written like this at www.presidentsgroup.com/asp/apply.htm - try submitting the form without the required fields filled out. The fucntion itself is written in javascript but has anyone ever seen anything like that done in vb?

-Ryan.
 

Users who are viewing this thread

Back
Top Bottom