I have Word 2010 runing on Win7. I am new to VBA and I am haveing trouble with two things:
First: this code returns two message boxes everytime Me.txtFireCredit.value = 0;
[VBA]Private Sub CKFire1_Click()
If Me.txtFireCredit.Value = 0 Then
MsgBox "You have selected 0 credit hours for Fire. If you wish to change this please do so on the Course Information Page."
CKFire1.Enabled = False
CKFire1.Value = False
GoTo NrmFire1
Exit Sub
End If
NrmFire1:
If CKFire1.Value = False Then
Fire1.Visible = False
ElseIf CKFire1.Value = True Then
Fire1.Visible = True
End If
End Sub
[/VBA]
Second, I have a list box in a frame that is enabled by the check boxes above name goes CKFire1 = Fire check box, Fire1 = Fire Frame with a list box, LBFire1 = listbox inside the frame. I am having no problems getting the frames to show up but i can not make the check box enable again if noting is selected in the list box: here is the code :
[VBA]
Private Sub CKBld1_Click()
Dim i As Integer
Dim j As Integer
If Me.txtBldCredit.Value = "0" Or Me.txtBldCredit.Value = "00" Then
MsgBox "You have selected 0 credit hours for Building. If you wish to change this please do so on the Course Information Page."
CKBld1.Enabled = False And CKBld1.Value = False And Bld1.Visible = False
GoTo NrmBld1
Exit Sub
End If
NrmBld1:
For i = 0 To LBBld1.ListCount - 1
If LBBld1.Selected(i) Then j = j + 1
Next i
If j > 0 Then
CKBld1.Enabled = True
CKBld1.Locked = False
ElseIf j = 0 Then
CKBld1.Enabled = False
CKBld1.Locked = True
End If
If CKBld1.Value = False Then
Bld1.Visible = False
ElseIf CKBld1.Value = True Then
Bld1.Visible = True
End If
End Sub
[/VBA]
Thank you in advace, this has been bothering me all morning