..I admit its a clumsy title. I was helped with this Next button by another more experienced member. The code will advance the cursor
position down 1 record as it shout but in two textboxes. These are independent search results.
BUTTON CODE:
CALL GETVERSES(Me.txtNextID) CODE
Issue: every time the Next button is clicked, the cursor moves down to the next record in the first textbox on the left, named txtMatchedVerses.
This code is also moving moving down the records in Textbox2. I cannot correct this code to work only on the first textbox.
Could anyone help?
Thanks, cr
position down 1 record as it shout but in two textboxes. These are independent search results.
BUTTON CODE:
Code:
Private Sub NextVerse_Click()
Dim i As Integer
Dim sText As String
If Not IsNull(Me.txtNextID) Then
Call getVerses(Me.txtNextID)
End If
End Sub
CALL GETVERSES(Me.txtNextID) CODE
Code:
Private Sub getVerses(ByVal ID As Variant)
Dim bm As Variant
Dim sKjv As String, sNASB As String
If Not IsNull(ID) Then
Me.txtID = ID
Me![txtSearchCriteria] = DLookup("verse", "tblBibles", "ID=" & ID)
With rs
.Seek "=", ID
bm = .Bookmark
.Move -1 ' Changed 10 to 1 to move 1 verse only not 10
Me.txtPrevID = !ID
.Seek "=", ID
.Move 1 ' Changed 10 to 1 to move 1 verse only not 10
Me.txtNextID = !ID
.Bookmark = bm
i = 1
Do While Not .EOF
sKjv = sKjv & !KJV & vbNewLine & vbNewLine
sNASB = sNASB & !NASB & vbNewLine & vbNewLine
i = i + 1
If i > 10 Then
sKjv = Left$(sKjv, Len(sKjv) - 2)
sNASB = Left$(sNASB, Len(sNASB) - 2)
Exit Do
End If
.MoveNext
Loop
End With
Me.txtMatchedVerses = sKjv
Me.Textbox2 = sNASB
End If
End Sub
Issue: every time the Next button is clicked, the cursor moves down to the next record in the first textbox on the left, named txtMatchedVerses.
This code is also moving moving down the records in Textbox2. I cannot correct this code to work only on the first textbox.
Could anyone help?
Thanks, cr