I having problems with the box.net. This is what I was looking at. It generates the form through a button make booking but I also wanted the option to generate an email.
This workbook was prepared and coded by Martin Green to help
' Excel users learn about VBA. Visit my web site for tips and
' tutorials on Microsoft Office and details of my Training and
' Consultancy services:
http://www.fontstuff.com
'==============================================================
Private Sub chkLunch_Change()
If chkLunch = True Then
chkVegetarian.Enabled = True
Else
chkVegetarian.Enabled = False
chkVegetarian = False
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClearForm_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdOK_Click()
ActiveWorkbook.Sheets("Course Bookings").Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 1) = txtPhone.Value
ActiveCell.Offset(0, 2) = cboDepartment.Value
ActiveCell.Offset(0, 3) = cboCourse.Value
If optIntroduction = True Then
ActiveCell.Offset(0, 4).Value = "Intro"
ElseIf optIntermediate = True Then
ActiveCell.Offset(0, 4).Value = "Intermed"
Else
ActiveCell.Offset(0, 4).Value = "Adv"
End If
If chkLunch = True Then
ActiveCell.Offset(0, 5).Value = "Yes"
Else
ActiveCell.Offset(0, 5).Value = "No"
End If
If chkVegetarian = True Then
ActiveCell.Offset(0, 6).Value = "Yes"
Else
If chkLunch = False Then
ActiveCell.Offset(0, 6).Value = ""
Else
ActiveCell.Offset(0, 6).Value = "No"
End If
End If
Range("A1").Select
End Sub
Private Sub UserForm_Initialize()
txtName.Value = ""
txtPhone.Value = ""
With cboDepartment
.AddItem "Sales"
.AddItem "Marketing"
.AddItem "Administration"
.AddItem "Design"
.AddItem "Advertising"
.AddItem "Dispatch"
.AddItem "Transportation"
End With
cboDepartment.Value = ""
With cboCourse
.AddItem "Access"
.AddItem "Excel"
.AddItem "PowerPoint"
.AddItem "Word"
.AddItem "FrontPage"
End With
cboCourse.Value = ""
optIntroduction = True
chkLunch = False
chkVegetarian = False
txtName.SetFocus
End Sub
The button on worksheet was
Sub OpenCourseBookingForm()
frmCourseBooking.Show
End Sub