wlssoftware
Technical User
I have 8 small tables that I have consolidated into a form with tabs for each table. I do not like the standard record selectors at the bottom of the form and created buttons for all the selections. After a great deal of searching and trial and error is was able to get one set of buttons work for each tab and table. Now I am trying to create a message when the end or the beginning for the records. The code is below. Does anyone have an answer? Thanks.
Private Sub cmdSF1Next_Click()
On Error GoTo Err_cmdSF1Next_Click
Dim numSF1Tab As Integer
Dim strSF1Tab As String
numSF1Tab = Me!TabCtl0.Value
Select Case numSF1Tab
Case 0
strSF1Tab = "Additions"
Forms![Wine SF1]![sf-Additions].SetFocus
DoCmd.GoToRecord , , acNext
If ??????????????? Then
'Check for EOF or BOF
DoCmd.GoToRecord , , acLast
MsgBox "You are at the Last " + strSF1Tab + "!'"
End If
Case 1
strSF1Tab = "Appellations"
Forms![Wine SF1]![sf-Appellation].SetFocus
Case 2
strSF1Tab = "Barrel Types"
Forms![Wine SF1]![sf-BarrelType].SetFocus
Case 3
strSF1Tab = "Bottles"
Forms![Wine SF1]![sf-Bottles].SetFocus
End Select
Private Sub cmdSF1Next_Click()
On Error GoTo Err_cmdSF1Next_Click
Dim numSF1Tab As Integer
Dim strSF1Tab As String
numSF1Tab = Me!TabCtl0.Value
Select Case numSF1Tab
Case 0
strSF1Tab = "Additions"
Forms![Wine SF1]![sf-Additions].SetFocus
DoCmd.GoToRecord , , acNext
If ??????????????? Then
'Check for EOF or BOF
DoCmd.GoToRecord , , acLast
MsgBox "You are at the Last " + strSF1Tab + "!'"
End If
Case 1
strSF1Tab = "Appellations"
Forms![Wine SF1]![sf-Appellation].SetFocus
Case 2
strSF1Tab = "Barrel Types"
Forms![Wine SF1]![sf-BarrelType].SetFocus
Case 3
strSF1Tab = "Bottles"
Forms![Wine SF1]![sf-Bottles].SetFocus
End Select