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

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???????
wlwebbAsked:
Who is Participating?
 
IrogSintaConnect With a Mentor Commented:
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
 
IrogSintaConnect With a Mentor Commented:
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
 
wlwebbAuthor Commented:
That is true except that the number could in fact change over time.....
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
IrogSintaCommented:
Yes, but you still know the number, right?  My understanding is that you create a certain number of records depending on some input.
0
 
IrogSintaCommented:
Don't you have that number stored in a variable or textbox?  If not then you can do a DCount of your table.
0
 
wlwebbAuthor Commented:
Uuuughhh , Yes......  I'll be right back with my "attempt" at that code.........
0
 
wlwebbAuthor Commented:
This did it!! Thanks Irog

    If Me.CurrentRecord = Me.txtCountActiveCurrencies Then
   
    Me.txtWaiting.Locked = False
    Me.txtWaiting.TabStop = True
    Me.txtWaiting.SetFocus
0
 
wlwebbAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.