[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Access - Tabbed Form - Continuous Subform Control - 1 Input field per record -

Posted on 2012-09-11
8
Medium Priority
?
499 Views
Last Modified: 2012-09-11
Hello all,

May be a picky question but here goes.

Have this tabbed form.  8 tabs each with a subform as a control.

On one particular tab, the form loads via a command button and it sets up a specific number of records to be filled in.  The form is limited to filling in only those particular number of records.  The user is inputting 1 amount in a field called Amount.

So they input Amount record 1, Amount record 2, Amount record 3, Amount record 4 etc....
When the hit tab or enter it of course goes from record 1 to 2 to 3 .... but when they get to the last record of the form and hit enter it sits on that line with the amount highlighted.  I think that's dangerous in that when they go to switch tabs they could hit another key and not know it because the other tabbed form opens....

I tried a very narrow unbound text box that's locked but tab enabled but, they have to hit the enter or tab key twice to go to the next line.

Is there a way, that I can code some sort of rowcount for the displayed form lines and when they get to that last line it unlocks or enables the tab stop but disables the tab stop to that unbound box if they're on line 1, 2, 3 etc whatever row BEFORE the last row on the input form???????
0
Comment
Question by:wlwebb
  • 4
  • 4
8 Comments
 
LVL 29

Assisted Solution

by:IrogSinta
IrogSinta earned 2000 total points
ID: 38389647
Since you know beforehand how many records there are, you can put code in the AfterUpdate event of the textbox.  This will check to see if it's the last record and if so, set focus somewhere else.


If Me.CurrentRecord = VariableWithNumberOfRecords Then Me.SomeOtherControl.SetFocus

Open in new window

0
 

Author Comment

by:wlwebb
ID: 38389659
That is true except that the number could in fact change over time.....
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38389661
Yes, but you still know the number, right?  My understanding is that you create a certain number of records depending on some input.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 29

Expert Comment

by:IrogSinta
ID: 38389662
Don't you have that number stored in a variable or textbox?  If not then you can do a DCount of your table.
0
 

Author Comment

by:wlwebb
ID: 38389664
Uuuughhh , Yes......  I'll be right back with my "attempt" at that code.........
0
 

Author Comment

by:wlwebb
ID: 38389686
This did it!! Thanks Irog

    If Me.CurrentRecord = Me.txtCountActiveCurrencies Then
   
    Me.txtWaiting.Locked = False
    Me.txtWaiting.TabStop = True
    Me.txtWaiting.SetFocus
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 38389703
If you had another control in your subform such as a button you could just set the focus there instead using this txtWaiting textbox.  Or if you didn't, you could put the txtWaiting textbox in the header or footer of your subform (tabstop set to false) and just set focus there.  No need for unlocking and setting tab stops.
0
 

Author Closing Comment

by:wlwebb
ID: 38389729
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question