View Single Post
 
Old 05-21-2014, 09:55 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Private Sub OKButton_Click()
Dim oTbl As Word.Table
Dim oRow As Row
Dim oRng As Word.Range
  Select Case True
    Case DescriptionBox = vbNullString
      MsgBox "You must enter a description"
    Case Not IsDate(DateBox)
      MsgBox "You must enter a valid date."
    Case PriorityCombo = vbNullString
      MsgBox "You must select the priority."
    Case Else
      Set oTbl = ActiveDocument.Tables(1)
      Set oRow = oTbl.Rows.Add
      oRow.Cells(1).Range.Text = DescriptionBox.Text
      oRow.Cells(2).Range.Text = DateBox.Text
      oRow.Cells(3).Range.Text = PriorityCombo.Text
      Unload Me
  End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote