Design View = Text 6 Char =Next Column

amerifax

Registered User.
Local time
Today, 03:15
Joined
Apr 9, 2007
Messages
304
My Table has the following fields:
Example:
Field A = aaabbb
Field B = aa-aaa
Field C = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

When I fill the fields I want them to advance to the next field if they have the maximum characters, 6 char in Field A & 5 Char in Field B. I have been able to auto enter the "-" with no problem in Field B. I only use Field C when I want to make a note. I'm not using a form view. I'm trying to avoid unnecessarily keys to continue.

Work Flow:
Field A - 6 char auto advance to Field B
Field B - 5 char auto advance to Field A
Field C - I use mouse to select since it's a rare event.

Bob
 
Last edited:
Your user really shouldn't be interacting directly with the data at table level.

The user should only see the data in the table through the "Filter" of a form, in this way you are able to present that data in a more meaningful way, as well as control how the user is able to interact with that data.

If you use a form you could use some code similar to that presented below in the field's On Change event;
Code:
    Me.Dirty = False
    
    If Len(Me.YourFieldName) = 6 Then
        Me.YourNextFieldName.SetFocus
    End If
 
Maybe something like this using the OnChange Event of the textbox:
Code:
Private Sub controlname_Change ()
 
   If Len(Me.controlname.Text) = 6 Then Me.nextcontrolname.SetFocus
 
End Sub
 
Ah yes if you use Me.Control.Text you don't need to set the Dirty property to False :o
 
Sorry guys I thought I was the only one up at this late hours. I decided to make it more clear on what I was doing and did a edit on my topic.

Bob
 
>>John Big Booty <<
I think your right. I was just testing the waters to night to see what direction I wanted to go.
Bob
 
That worked great for my first field, but not my second field. The field is a text field and it 6 characters. One of those characters is a "-". The format of the field is __-___. When I try to use the same code in the second field I get the following error:

Run-Time error '2110':

Microsoft Access can't move the focus to the control Ins_Cert.

Any ideas what I'm doing wrong?

Bob
 

Users who are viewing this thread

Back
Top Bottom