HDfatboy03
Board Regular
- Joined
- May 23, 2010
- Messages
- 62
Hello ... I have a working form and I want to ad check boxes to answer a simple question yes or no.
This is what I have so far
Private Sub UserForm_Click()
Private Sub cmdAdd3_Click()
Dim iRow As Long
Dim ws, ws2 As Worksheet
'Dim ws As Worksheet
Set ws = Worksheets("CoursesDB")
Set ws2 = Worksheets("CurDB")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtPart.Value) = "" Then
Me.txtPart.SetFocus
MsgBox "Please enter a Course Name"
Exit Sub
End If
'copy the data to the databases
ws.Cells(iRow, 1).Value = Me.txtPart.Value
ws2.Cells(4, "C").Value = Me.txtPart.Value
'Here is the part ... check box where I need assistance ... I want the information to go to ws and to (iRow, 114)
If ws.CheckBox1 = True Then
MsgBox "True" ws.Cells(iRow, 114)
Else
MsgBox "False" ws.Cells(iRow, 114)
'D E L E T E T H E F O R M STARTS HERE
'clear the data
Me.txtPart.Value = ""
Me.txtPart.SetFocus
End Sub
End If<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Any assistance will be greatly appreciated
Thanks in advance
Bob
This is what I have so far
Private Sub UserForm_Click()
Private Sub cmdAdd3_Click()
Dim iRow As Long
Dim ws, ws2 As Worksheet
'Dim ws As Worksheet
Set ws = Worksheets("CoursesDB")
Set ws2 = Worksheets("CurDB")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtPart.Value) = "" Then
Me.txtPart.SetFocus
MsgBox "Please enter a Course Name"
Exit Sub
End If
'copy the data to the databases
ws.Cells(iRow, 1).Value = Me.txtPart.Value
ws2.Cells(4, "C").Value = Me.txtPart.Value
'Here is the part ... check box where I need assistance ... I want the information to go to ws and to (iRow, 114)
If ws.CheckBox1 = True Then
MsgBox "True" ws.Cells(iRow, 114)
Else
MsgBox "False" ws.Cells(iRow, 114)
'D E L E T E T H E F O R M STARTS HERE
'clear the data
Me.txtPart.Value = ""
Me.txtPart.SetFocus
End Sub
End If<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Any assistance will be greatly appreciated
Thanks in advance
Bob