Sub Document_New()
'Procedure to show UserForm frmWelcomeAboardInput
'Written by Brandon 11/11/14
frmWelcomeAboardInput.Show
End Sub
Option Explicit
Sub cmdClose_Click()
'Procedure for button cmdClose
'Written by Brandon 14/11/14
End
End Sub
Sub cmdLog_Click()
'Procedure for button cmdLog
'Written by Brandon 14/11/14
Dim DateString, myPathAndFile As String
DateString = Format(Date, "Short Date")
myPathAndFile = ThisDocument.Path & "\Log.txt"
Open myPathAndFile For Append As #1
Write #1, DateString, txtDearFirstName.Value, txtFirstName.Value, txtLastName.Value, txtGender.Value, txtDateofBirth.Value, txtAddress.Value, txtSuburb.Value, txtState.Value, txtPostcode.Value, txtRole.Value
Close #1
End Sub
Sub cmdOK_Click()
'Procedure for click on button cmdOK
'Written Brandon 11/11/14
ActiveDocument.Bookmarks("DearFirstName").Range.Text = txtDearFirstName.Value
ActiveDocument.Bookmarks("FirstName").Range.Text = txtFirstName.Value
ActiveDocument.Bookmarks("LastName").Range.Text = txtLastName.Value
ActiveDocument.Bookmarks("Gender").Range.Text = txtGender.Value
ActiveDocument.Bookmarks("DateOfBirth").Range.Text = txtDateofBirth.Value
ActiveDocument.Bookmarks("Address").Range.Text = txtAddress.Value
ActiveDocument.Bookmarks("Suburb").Range.Text = txtSuburb.Value
ActiveDocument.Bookmarks("State").Range.Text = txtState.Value
ActiveDocument.Bookmarks("Postcode").Range.Text = txtPostcode.Value
ActiveDocument.Bookmarks("Role").Range.Text = txtRole.Value
frmWelcomeAboardInput.Hide
End Sub
Sub cmdClear_Click()
'Procedure for button Clear
'Written by Brandon 11/11/14
txtDearFirstName.Value = Null
txtFirstName.Value = Null
txtLastName.Value = Null
txtGender.Value = Null
txtDateofBirth.Value = Null
txtAddress.Value = Null
txtSuburb.Value = Null
txtState.Value = Null
txtPostcode.Value = Null
txtRole.Value = Null
End Sub