If anyone can help me I'd very much appreciate it. I'm really rust where VB is concerned and my book isn't helping much.
I have a form called NonBargainingView. Within the form is a text box called Degree.
When a command button is pushed (called Command23) I want Access to look and see if the word Graduate is in Degree. If it is I want a macro called NonBargGradTax to run. If anything else is in the box I want the macro NonBargGradTax to run.
I know my problem lies in looking at the Degree box (at least that's where I'm getting my errors) but I don't have a clue as to how to fix it. I've guessed as to what I'm suppose to declare everything. Is that where I'm going wrong?
Thank You in Advance for any help!
Private Sub Command23_Click()
Dim NonBargainingView As Form
Dim Degree As TextBox
Dim Grad As String
Dim Under As String
Grad = "NonBargGradTax"
Under = "NonBargGradTax"
If NonBargainingView.Degree = "Graduate" Then
DoCmd.RunMacro Grad
Else
DoCmd.RunMacro Under
End If
End Sub
I have a form called NonBargainingView. Within the form is a text box called Degree.
When a command button is pushed (called Command23) I want Access to look and see if the word Graduate is in Degree. If it is I want a macro called NonBargGradTax to run. If anything else is in the box I want the macro NonBargGradTax to run.
I know my problem lies in looking at the Degree box (at least that's where I'm getting my errors) but I don't have a clue as to how to fix it. I've guessed as to what I'm suppose to declare everything. Is that where I'm going wrong?
Thank You in Advance for any help!
Private Sub Command23_Click()
Dim NonBargainingView As Form
Dim Degree As TextBox
Dim Grad As String
Dim Under As String
Grad = "NonBargGradTax"
Under = "NonBargGradTax"
If NonBargainingView.Degree = "Graduate" Then
DoCmd.RunMacro Grad
Else
DoCmd.RunMacro Under
End If
End Sub