I am trying to create a button on a userform that will goto the next entry. The code that I am using (although it is not working). Thank you.
The userform is called frmData, txt is a text box, cbo is a combobox, and cb is a checkbox.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
Private Sub btnNext_Click()
CurRow = Range("CurRow").Value
Range("A" & CurRow).Value = frmData.txtCase.Text
Range("B" & CurRow).Value = frmData.txtEnd.Text
Range("C" & CurRow).Value = frmData.txtReview.Text
Range("D" & CurRow).Value = frmData.cboDx.Text
Range("E" & CurRow).Value = frmData.txtAge.Text
Range("F" & CurRow).Value = frmData.cboAge.Text
Range("G" & CurRow).Value = frmData.cboGnder.Text
Range("H" & CurRow).Value = frmData.cboStatus.Text
Range("I" & CurRow).Value = frmData.cbLSAB.Value
Range("J" & CurRow).Value = frmData.cbSSPHR.Value
Range("K" & CurRow).Value = frmData.cbSSPLR.Value
Range("L" & CurRow).Value = frmData.cbSBT.Value
Range("M" & CurRow).Value = frmData.cboDonor.Text
Range("N" & CurRow).Value = frmData.txtType.Text
Range("O" & CurRow).Value = frmData.txtKey.Text
If CurRow = Range("A65536").End(xlUp).Row Then GoTo LastRec
CurRow = CurRow + 1
Range("CurRow").Value = CurRow
frmData.txtCase.Value = Range("A" & CurRow).Value
frmData.txtEnd.Value = Range("B" & CurRow).Value
frmData.txtReview.Value = Range("C" & CurRow).Value
frmData.cboDx.Value = Range("D" & CurRow).Value
frmData.txtAge.Value = Range("E" & CurRow).Value
frmData.cboAge.Value = Range("F" & CurRow).Value
frmData.cboGender.Value = Range("G" & CurRow).Value
frmData.cboStatus.Value = Range("H" & CurRow).Value
frmData.cbLSAB.Value = Range("I" & CurRow).Value
frmData.cbSSPHR.Value = Range("J" & CurRow).Value
frmData.cbSSPLR.Value = Range("K" & CurRow).Value
frmData.cbSBT.Value = Range("L" & CurRow).Value
frmData.cboDonor.Value = Range("M" & CurRow).Value
frmData.txtType.Value = Range("N" & CurRow).Value
frmData.txtKey.Value = Range("O" & CurRow).Value
Exit Sub
End Sub
The userform is called frmData, txt is a text box, cbo is a combobox, and cb is a checkbox.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
Private Sub btnNext_Click()
CurRow = Range("CurRow").Value
Range("A" & CurRow).Value = frmData.txtCase.Text
Range("B" & CurRow).Value = frmData.txtEnd.Text
Range("C" & CurRow).Value = frmData.txtReview.Text
Range("D" & CurRow).Value = frmData.cboDx.Text
Range("E" & CurRow).Value = frmData.txtAge.Text
Range("F" & CurRow).Value = frmData.cboAge.Text
Range("G" & CurRow).Value = frmData.cboGnder.Text
Range("H" & CurRow).Value = frmData.cboStatus.Text
Range("I" & CurRow).Value = frmData.cbLSAB.Value
Range("J" & CurRow).Value = frmData.cbSSPHR.Value
Range("K" & CurRow).Value = frmData.cbSSPLR.Value
Range("L" & CurRow).Value = frmData.cbSBT.Value
Range("M" & CurRow).Value = frmData.cboDonor.Text
Range("N" & CurRow).Value = frmData.txtType.Text
Range("O" & CurRow).Value = frmData.txtKey.Text
If CurRow = Range("A65536").End(xlUp).Row Then GoTo LastRec
CurRow = CurRow + 1
Range("CurRow").Value = CurRow
frmData.txtCase.Value = Range("A" & CurRow).Value
frmData.txtEnd.Value = Range("B" & CurRow).Value
frmData.txtReview.Value = Range("C" & CurRow).Value
frmData.cboDx.Value = Range("D" & CurRow).Value
frmData.txtAge.Value = Range("E" & CurRow).Value
frmData.cboAge.Value = Range("F" & CurRow).Value
frmData.cboGender.Value = Range("G" & CurRow).Value
frmData.cboStatus.Value = Range("H" & CurRow).Value
frmData.cbLSAB.Value = Range("I" & CurRow).Value
frmData.cbSSPHR.Value = Range("J" & CurRow).Value
frmData.cbSSPLR.Value = Range("K" & CurRow).Value
frmData.cbSBT.Value = Range("L" & CurRow).Value
frmData.cboDonor.Value = Range("M" & CurRow).Value
frmData.txtType.Value = Range("N" & CurRow).Value
frmData.txtKey.Value = Range("O" & CurRow).Value
Exit Sub
End Sub