Hello D.A.S.,
Add this code to your UserForm1 code. This will display the first record when the form is displayed.
![]()
Private Sub UserForm_Activate() SpinButton1.Value = 2 TextBox7.Value = SpinButton1.Value ShowCurrentRecord End Sub
Hello D.A.S.,
Add this code to your UserForm1 code. This will display the first record when the form is displayed.
![]()
Private Sub UserForm_Activate() SpinButton1.Value = 2 TextBox7.Value = SpinButton1.Value ShowCurrentRecord End Sub
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Hi Leith,
I added the code to the UserForm1 code but now brings up the following error when the form is opened:
In the above " R = .SpinButton1.Value + 1 " is highlighted when I debeg ....Thoughts?![]()
Sub ShowCurrentRecord() Dim Wks As Worksheet Set Wks = ThisWorkbook.Worksheets(1) With UserForms(0) R = .SpinButton1.Value + 1 .txtContName = Wks.Cells(R, "B").Value .txtClientFirstName = Wks.Cells(R, "C").Value .txtClientLastName = Wks.Cells(R, "D").Value .txtIntContDat = Wks.Cells(R, "E").Value .txtIntAssessDat = Wks.Cells(R, "F").Value .txtIntContComp = Wks.Cells(R, "G").Value .ComboContType = Wks.Cells(R, "H").Value .txtDisCost = Format(Wks.Cells(R, "I").Value, "Currency") .txtremCost = Format(Wks.Cells(R, "J").Value, "Currency") .txtTCSent.Value = Wks.Cells(R, "K").Value .txtTCRec.Value = Wks.Cells(R, "L").Value .ComboContStatus.Value = Wks.Cells(R, "M").Value .txtSiteUnitNo.Value = Wks.Cells(R, "N").Value .txtSiteStAdrs.Value = Wks.Cells(R, "O").Value .txtSiteSuburb.Value = Wks.Cells(R, "P").Value .txtSiteCity.Value = Wks.Cells(R, "Q").Value .txtPostUnitNo.Value = Wks.Cells(R, "R").Value .txtPostStAdrs.Value = Wks.Cells(R, "S").Value .txtSiteSuburb.Value = Wks.Cells(R, "T").Value .txtPostCity.Value = Wks.Cells(R, "U").Value .txtHomePh.Value = Wks.Cells(R, "V").Value .txtWorkPh.Value = Wks.Cells(R, "W").Value .txtMobPh.Value = Wks.Cells(R, "X").Value .txtEmail.Value = Wks.Cells(R, "Y").Value .txtPrinDis.Value = Wks.Cells(R, "Z").Value .txtPrinRem.Value = Wks.Cells(R, "AA").Value .txtAdCont1FNam.Value = Wks.Cells(R, "AB").Value .txtAdCont1LNam.Value = Wks.Cells(R, "AC").Value .txtAdCont1HomePh.Value = Wks.Cells(R, "AD").Value .txtAdCont1WorkPh.Value = Wks.Cells(R, "AE").Value .txtAdCont1MobPh.Value = Wks.Cells(R, "AF").Value .txtAdCont1Email.Value = Wks.Cells(R, "AG").Value .txtAdCont2FNam.Value = Wks.Cells(R, "AH").Value .txtAdCont2LNam.Value = Wks.Cells(R, "AI").Value .txtAdCont2HomePh.Value = Wks.Cells(R, "AJ").Value .txtAdCont2WorkPh.Value = Wks.Cells(R, "AK").Value .txtAdCont2MobPh.Value = Wks.Cells(R, "AL").Value .txtAdCont2Email.Value = Wks.Cells(R, "AM").Value .txtAdCont3FNam.Value = Wks.Cells(R, "AN").Value .txtAdCont3LNam.Value = Wks.Cells(R, "AO").Value .txtAdCont3HomePh.Value = Wks.Cells(R, "AP").Value .txtAdCont3WorkPh.Value = Wks.Cells(R, "AQ").Value .txtAdCont3MobPh.Value = Wks.Cells(R, "AR").Value .txtAdCont3Email.Value = Wks.Cells(R, "AS").Value .txtAdCont4FNam.Value = Wks.Cells(R, "AT").Value .txtAdCont4LNam.Value = Wks.Cells(R, "AU").Value .txtAdCont4HomePh.Value = Wks.Cells(R, "AV").Value .txtAdCont4WorkPh.Value = Wks.Cells(R, "AW").Value .txtAdCont4MobPh.Value = Wks.Cells(R, "AX").Value .txtAdCont4Email.Value = Wks.Cells(R, "AY").Value .txtNotes.Value = Wks.Cells(R, "AZ").Value .TextBox7.Value = .SpinButton1.Value End With End Sub
Last edited by Leith Ross; 11-22-2013 at 06:19 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks