The code I provided would go at the top of your UpdateForm macro. (the part in red)
The code I provided would go at the top of your UpdateForm macro. (the part in red)
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Ok so I put the code below but I get an error and when I debug it outlines the Sub field
![]()
Sub Update_Form() Dim t As Control, res As VbMsgBoxResult For Each t In Me.Controls If TypeName(t) = "TextBox" Then ' Make sure we're only looking at textboxes. If t.Text = vbNullString And t.Tag <> vbNullString Then res = MsgBox("You've not completed the " + t.Tag + " field. Would you like to complete it now?", vbYesNo + vbQuestion) If res = vbYes Then Exit Sub End If Next txtass.Value = Cells(Currentrow, 1).Value TxtComp.Value = Cells(Currentrow, 2).Value TxtDoc.Value = Cells(Currentrow, 3).Value Txtdlname.Value = Cells(Currentrow, 4).Value txtdoct.Value = Cells(Currentrow, 5).Value Txtdocto.Value = Cells(Currentrow, 6).Value TxtFname.Value = Cells(Currentrow, 7).Value TxtLname.Value = Cells(Currentrow, 8).Value TxtIns.Value = Cells(Currentrow, 9).Value Txteml.Value = Cells(Currentrow, 10).Value TxtPho.Value = Cells(Currentrow, 11).Value Txtcellp.Value = Cells(Currentrow, 12).Value Txtgndr.Value = Cells(Currentrow, 13).Value Txtrac.Value = Cells(Currentrow, 14).Value TxtDOB.Value = Cells(Currentrow, 15).Value Txtage.Value = Cells(Currentrow, 16).Value Txthin.Value = Cells(Currentrow, 17).Value Txtwip.Value = Cells(Currentrow, 18).Value Txtwd.Value = Cells(Currentrow, 19).Value Txttcl.Value = Cells(Currentrow, 20).Value Txttcld.Value = Cells(Currentrow, 21).Value Txthdl.Value = Cells(Currentrow, 22).Value Txtldl.Value = Cells(Currentrow, 23).Value Txtbps.Value = Cells(Currentrow, 24).Value Txtbpd.Value = Cells(Currentrow, 25).Value Txtbptd.Value = Cells(Currentrow, 26).Value Txtla1c.Value = Cells(Currentrow, 27).Value Txtla1cd.Value = Cells(Currentrow, 28).Value Txtedwd.Value = Cells(Currentrow, 29).Value Txtdd.Value = Cells(Currentrow, 30).Value Txtsw.Value = Cells(Currentrow, 31).Value Txtevr.Value = Cells(Currentrow, 32).Value Txtdn.Value = Cells(Currentrow, 33).Value End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks