workingpoor
Registered User.
- Local time
- Yesterday, 19:33
- Joined
- Jul 19, 2006
- Messages
- 21
THis has to be an easy issue.
I have a subform that in the on curren event i passes the ClassId out to my main for in an unbound text box
Forms![Student]![ClassID] = Me![ClassID]
I know this part works
I then have a command button that should pass ClassID to a report so that it can be filtered. Here is the on_click code
Private Sub cmdReprintAccom_Click()
On Error GoTo Err_cmdReprintAccom_Click
Dim stDocName As String
Dim strReptCriteria As String
strReptCriteria = ClassID
stDocName = "Forms - Accomodations"
DoCmd.OpenReport stDocName, acViewPreview, , _
"[ClassID] = '" & strReptCriteria & "'"
My problem is that I keep getting a type mismatch error. I know that it is because CLassID is a number and it is getting passed as a string i just can't figure out the syntax to the highlighted code.
I have a subform that in the on curren event i passes the ClassId out to my main for in an unbound text box
Forms![Student]![ClassID] = Me![ClassID]
I know this part works
I then have a command button that should pass ClassID to a report so that it can be filtered. Here is the on_click code
Private Sub cmdReprintAccom_Click()
On Error GoTo Err_cmdReprintAccom_Click
Dim stDocName As String
Dim strReptCriteria As String
strReptCriteria = ClassID
stDocName = "Forms - Accomodations"
DoCmd.OpenReport stDocName, acViewPreview, , _
"[ClassID] = '" & strReptCriteria & "'"
My problem is that I keep getting a type mismatch error. I know that it is because CLassID is a number and it is getting passed as a string i just can't figure out the syntax to the highlighted code.