本文介绍了选择案例错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为''paymnt''的列表框;它有2个值(check& creditcard)。就在paymnt之下,我有一个名为''sendpay''的命令按钮。我试图在''sendpay''中使用基于paymnt控件的Select语句。我认为可以做到......但它不起作用。任何人都可以看到新手不能做什么?非常感谢。这里的代码是:

[code] Private Sub sendpay_Click()

Select Case Me.paymnt.Value

Case" Check" ;

DoCmd.OpenForm" paymntcrdtcrd"

案例信用卡

DoCmd.OpenForm" paymentchk"

Case Else

结束选择

结束子


我已尝试过第一行价值,仍然没有奏效。我试过在第一行使用我和paymnt之间的感叹号。


我得到2447运行时错误无效使用。 (点)或!操作符或无效的括号


我哪里错了?

我试图用它来简化它:

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 "paymntcrdtcrd"
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:

展开 | 选择 | Wrap | 行号

推荐答案

展开 | 选择 | 换行 | 行号


展开 | 选择 | 换行 | 行号


展开 | 选择 | Wrap | 行号


这篇关于选择案例错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 09:34