excelconditional
New Member
- Joined
- Feb 21, 2017
- Messages
- 6
[FONT="]I am getting compile errors on the click command on the 'forward' and 'back buttons' on a form – can someone take a look?
My work book is on my one drive https://1drv.ms/u/s!Ag-WnkpUjiS9hy6MzsFk56w7ZJ8o
This is my form:
Previous button code:
[/FONT]
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">Private Sub Back_Click()</code>
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">'Prev
If ThisRow.Row > 2 Then
Set ThisRow = ThisRow.Offset(-1)
LoadData
End If
End Sub</code>
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">
</code>
Forward button code:
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">Private Sub Forward_Click()
If ThisRow.Row < Range("A" & Rows.Count).End(xlUp).Row Then
'Switch to the row and load the data
Set ThisRow = ThisRow.Offset(1)
LoadData
End If</code>
This code is not mine nor does it work for me. Can someone give me the exact code that will work on my form please?...
My work book is on my one drive https://1drv.ms/u/s!Ag-WnkpUjiS9hy6MzsFk56w7ZJ8o
This is my form:

Previous button code:
[/FONT]
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">Private Sub Back_Click()</code>
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">'Prev
If ThisRow.Row > 2 Then
Set ThisRow = ThisRow.Offset(-1)
LoadData
End If
End Sub</code>
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">
</code>
Forward button code:
<code style="box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; border: 0px; margin: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">Private Sub Forward_Click()
If ThisRow.Row < Range("A" & Rows.Count).End(xlUp).Row Then
'Switch to the row and load the data
Set ThisRow = ThisRow.Offset(1)
LoadData
End If</code>
This code is not mine nor does it work for me. Can someone give me the exact code that will work on my form please?...