By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Access 2003 Form: Data Entry - Auto Fill

P: 36
This may be a dream.
However I was wondering if the following scenario were possible within an Access 2003 Form.

If I have to fields [1] and [2], both of which are have limited field sizes of 4, Would it be possible for someone to have focus on field [1] enter 8 characters where the first 4 go into [1] of course and then continue the other 4 into field [2]
or
If someone scans an 8 digit bar code could the first 4 appear in one field and the other 4 in another?

I guess the simpler way would be to store it into one field and break it up after.
Which was the route I was going to go.

Thanks for any thoughts..Input.
Oct 15 '07 #1
Share this Question
Share on Google+
4 Replies


ADezii
Expert 5K+
P: 8,638
This may be a dream.
However I was wondering if the following scenario were possible within an Access 2003 Form.

If I have to fields [1] and [2], both of which are have limited field sizes of 4, Would it be possible for someone to have focus on field [1] enter 8 characters where the first 4 go into [1] of course and then continue the other 4 into field [2]
or
If someone scans an 8 digit bar code could the first 4 appear in one field and the other 4 in another?

I guess the simpler way would be to store it into one field and break it up after.
Which was the route I was going to go.

Thanks for any thoughts..Input.
Set the Field Size of the 1st Field to a Maximum of 8. Place this code in the AfterUpdate() Event of Field1:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtField1_AfterUpdate()
  2. If Len(Me![txtField1]) = 8 Then
  3.   Me![txtField2] = Right$(Me![txtField1], 4)
  4.   Me![txtField1] = Left$([txtField1], 4)
  5. Else
  6.   'not really sure what you want to do here
  7. End If
  8. End Sub
Oct 15 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
Actually, AutoTab is made for doing just this! Go to the first text box' Properties - Other and setting the AutoTab property to Yes.

For the first textbox also set the Input Mask to 0000 (that's all zeros).

Now make sure that the second text box is in line to receive focus after the first box.

If you start typing the 8 digit number in the first four will go in the first box and the second four will go in the second box.

Welcome to TheScripts!

Linq ;0)>
Oct 15 '07 #3

P: 36
Actually, AutoTab is made for doing just this! Go to the first text box' Properties - Other and setting the AutoTab property to Yes.

For the first textbox also set the Input Mask to 0000 (that's all zeros).

Now make sure that the second text box is in line to receive focus after the first box.

If you start typing the 8 digit number in the first four will go in the first box and the second four will go in the second box.

Welcome to TheScripts!

Linq ;0)>
Glad to be here. Thanks to for the Tips you two.
I ended up using the auto-tab with mask A0AA to get the data I needed.
Worked like a charm. Thanks again.
Oct 15 '07 #4

ADezii
Expert 5K+
P: 8,638
Actually, AutoTab is made for doing just this! Go to the first text box' Properties - Other and setting the AutoTab property to Yes.

For the first textbox also set the Input Mask to 0000 (that's all zeros).

Now make sure that the second text box is in line to receive focus after the first box.

If you start typing the 8 digit number in the first four will go in the first box and the second four will go in the second box.

Welcome to TheScripts!

Linq ;0)>
The old Auto Tab trick! Forgot about that one, linq - nice touch.
Oct 15 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.