Hello,
I've got a workaround for my problem, but I'm trying to learn about what it is that I'm missing. Here's what I ended up with, and it works just fine:
What I'd hoped to do was:
But when I do it this way, I get "Run-time error '2482': [ProgramName] cannot find the name 'RequestReimbEmail' you entered in the expression."
If you have the time, I'd love to learn why the latter code won't execute as I'd expected. Thanks.
I've got a workaround for my problem, but I'm trying to learn about what it is that I'm missing. Here's what I ended up with, and it works just fine:
Code:
Private Sub CheckAndProceed(bytRequest As Byte)
...Stuff happens to get the the select statement...
Select Case bytPreCheck
Case 1
strMessage = "You are about to request payment:"
Case 2
strMessage = "You are about to request PRE-PAYMENT:"
Case 11
strMessage = "You are about to update:"
Case 12
strMessage = "You are about to update for PRE-PAYMENT:"
End Select
strMessage = strMessage & vbCrLf & vbCrLf & " " & Chr(149) & intCount & " Payment Detail Record(s)." _
& vbCrLf & " " & Chr(149) & "Totaling " & strCurrency & " " & Format(sngSum, "Standard") _
& vbCrLf & vbCrLf & "Would you like to proceed?"
If MsgBox(strMessage, vbYesNo, "UPDATE RECORDS?") = vbYes Then
Select Case bytPreCheck
Case 1
RequestReimbEmail Me.txtSubjectID, False
Case 2
RequestReimbEmail Me.txtSubjectID, True
Case 11
MarkReadyToProcess intCount, Me.txtSubjectID, False
Case 12
MarkReadyToProcess intCount, Me.txtSubjectID, True
End Select
End If
End sub
What I'd hoped to do was:
Code:
Private Sub CheckAndProceed(bytRequest As Byte)
...Same stuff happening...
Select Case bytPreCheck
Case 1
strMessage = "You are about to request payment:"
strFunction = "RequestReimbEmail Me.txtSubjectID, False"
Case 2
strMessage = "You are about to request PRE-PAYMENT:"
strFunction = "RequestReimbEmail Me.txtSubjectID, True"
Case 11
strMessage = "You are about to update:"
strFunction = "MarkReadyToProcess intCount, Me.txtSubjectID, False"
Case 12
strMessage = "You are about to update for PRE-PAYMENT:"
strFunction = "MarkReadyToProcess intCount, Me.txtSubjectID, True"
End Select
strMessage = strMessage & vbCrLf & vbCrLf & " " & Chr(149) & intCount & " Payment Detail Record(s)." _
& vbCrLf & " " & Chr(149) & "Totaling " & strCurrency & " " & Format(sngSum, "Standard") _
& vbCrLf & vbCrLf & "Would you like to proceed?"
If MsgBox(strMessage, vbYesNo, "UPDATE RECORDS?") = vbYes Then Eval (strFunction)
End Sub
But when I do it this way, I get "Run-time error '2482': [ProgramName] cannot find the name 'RequestReimbEmail' you entered in the expression."
If you have the time, I'd love to learn why the latter code won't execute as I'd expected. Thanks.