I have a listbox called 'paymnt' ; it has 2 values (check & creditcard). Just below paymnt, I have a command button called 'sendpay' . I am trying to use a Select statement in 'sendpay' based on the paymnt control. I think it can be done.. but it's not working. Can anyone see what a newbie can't? thanks so much. Here's the code:
[CODE]Private Sub sendpay_Click()
Select Case Me.paymnt.Value
Case "Check"
DoCmd.OpenForm "paymntcrdt crd"
Case "Credit Card"
DoCmd.OpenForm "paymentchk "
Case Else
End Select
End Sub
I've tried the first line without Value, still didn't work. I've tried using an exclamation between Me and paymnt on first line.
I get a 2447 run-time error "invalid use of the . (dot) or ! operator or invalid parenthesis"
Where am I going wrong?
I've tried to simplify it with this:
I've searched all over, can't seem to nail this one.
Any ideas??? thanks in advance.
imrosie
[CODE]Private Sub sendpay_Click()
Select Case Me.paymnt.Value
Case "Check"
DoCmd.OpenForm "paymntcrdt crd"
Case "Credit Card"
DoCmd.OpenForm "paymentchk "
Case Else
End Select
End Sub
I've tried the first line without Value, still didn't work. I've tried using an exclamation between Me and paymnt on first line.
I get a 2447 run-time error "invalid use of the . (dot) or ! operator or invalid parenthesis"
Where am I going wrong?
I've tried to simplify it with this:
Code:
Private Sub sendpay_Click() If Me![paymnt].Value = 1 Then DoCmd.OpenForm "paymntcrdtcrd" Else DoCmd.OpenForm "paymntchk" End If
Any ideas??? thanks in advance.
imrosie
Comment