Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not Advancing to the next record

Status
Not open for further replies.

StacyStacy

Programmer
Apr 16, 2003
60
US
My end user sent me the following: Can you assist me with a solution?

(my form is setup as a tabular form)

"If we are on any tab other than the first one ("provider-training location"), and we scroll to a different record, the next record defaults back to the first tab. In other words, there appears to be a set focus on the first tab. This slows us down considerably. For instance, we may want to search for a particular project code, so we go to the "approval" tab. However, when we click on the next record, we are thrown back to the first tab and then have to scroll over and select the approval tab again."

Thanks, StacyStacy
 
If they use the mousewheel or use the record navigation buttons at the bottom of the record to switch records, the 'current tab' should stay the same. If they're using the TAB key, then it would naturally 'cycle' to the first tab of the next record which is unfixable.

So if they're using the TAB key to switch records, then tell them to use the record navigation buttons or the mousewheel.


Otherwise check the form's Current() event and see what happens inside it, if anything.
 
Stacy

Check your code, specifically for the On Current record event. Look for a SetFocus command. A ReQuery may also do this.

You can cheat by "remebering" the current tab and use the SetFocus to return to the desired tab.
 
Thanks everyone! I don't want to SetFocus to a desired tab nor to a specific field other than the first field of each new tab when the cursor is in the previous field.

I tried using the navigational buttons in different fields throughout the application and it takes me back to the first tab of the same record.

Here's my code for the On Current record event on the form, which I need to populate some of the fields on the form:

Private Sub Form_Current()
Dim MyVar As String
If IsNull(Me.PROVIDERCODECOMBOBOX) Then
Me![Provider_Name] = " "
Me![Text310] = " "
Me![Text312] = " "
Me![Text314] = " "
Me![Text317] = " "
Me![Text319] = " "

Me![Text546] = "" 'county number

Me![Combotest] = ""

Exit Sub
End If
MyVar = Me.PROVIDERCODECOMBOBOX


LOCATIONNAMECOMBOBOX.RowSource = "SELECT * FROM [TT_TRAINING LOCATIONS] WHERE ([TT_TRAINING LOCATIONS].[PROVIDER_CODE]='" + Trim(MyVar) + "');"
LOCATIONNAMECOMBOBOX.Requery

Me!Provider_Name = [Forms]![EPL APPLICATION]!PROVIDERCODECOMBOBOX.Column(1)



Me![Pro_Loc_ID] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(3)
Me![Text310] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(4)
Me![Text312] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(5)
Me![Text314] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(6)
Me![Text317] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(7)
Me![Text319] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(8)
Me![Text546] = Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(9) ' this is the county number
Me![Combotest].RowSource = "select county_nam from county where state = '" & Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(7) & "'" & " and county_no = '" & Forms![EPL APPLICATION]![LOCATIONNAMECOMBOBOX].Column(9) & "';"
Me![Combotest].Requery
Me![Combotest] = Me![Combotest].Column(0, 0)

Me!LOCATIONNAMECOMBOBOX.SetFocus

End Sub


Additionally, I understand that this didn't happen with one of the first revisions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top