blackie1982
Registered User.
- Local time
- Today, 11:07
- Joined
- Jul 2, 2004
- Messages
- 18
Im sure that might be really simple but I just cant seem to get this if statement working. What I want to do is check a value in a form and then depending on that value open up the correct report. Heres my code
Dim stDocName As String
Dim docName As String
If (Forms![instrumentRecord]![CalibrationWQFNumber] = "WQF 7.6/1") Then
docName = "WQF761"
Else If (Forms![instrumentRecord]![CalibrationWQFNumber] = "WQF 7.6/4") Then
docName = "WQF764"
Else If (Forms![instrumentRecord]![CalibrationWQFNumber] = "WQF 7.6/22") Then
docName = "WQF7622"
Else docName = "WQF7625"
End If
stDocName = docName
DoCmd.OpenReport stDocName, acPreview
Dim stDocName As String
Dim docName As String
If (Forms![instrumentRecord]![CalibrationWQFNumber] = "WQF 7.6/1") Then
docName = "WQF761"
Else If (Forms![instrumentRecord]![CalibrationWQFNumber] = "WQF 7.6/4") Then
docName = "WQF764"
Else If (Forms![instrumentRecord]![CalibrationWQFNumber] = "WQF 7.6/22") Then
docName = "WQF7622"
Else docName = "WQF7625"
End If
stDocName = docName
DoCmd.OpenReport stDocName, acPreview