选择案例错误 [英] Select Case error

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

问题描述

我有一个名为''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 | 行号

推荐答案

列表框可能很棘手。你可以做的事情很少但是这里的东西会随你已经拥有的东西而流动。

List boxes can be tricky. There''s a few things you can do but here''s one that will flow with what you already have.

展开 | 选择 | 换行 | 行号



列表框可能很棘手。你可以做的事情很少但是这里的东西会随你已经拥有的东西而流动。

List boxes can be tricky. There''s a few things you can do but here''s one that will flow with what you already have.

展开 | 选择 | 换行 | 行号


ItemsSelected属性是一个集合,它包含列表框中任何选定项的所有行值。如果没有选择任何项目,您将收到该错误。我想我可能过于复杂了。


让我们来看看你的列表框属性。

如果你使用的是价值表,他们应该是这样的:
ItemsSelected Property is a collection that holds all the row values for any selected items in the listbox. If no item is selected you''ll get that error. I think I may have over complicated this.

Let''s take a look at your listbox properties.
If you''re using a value list They should look like this:
展开 | 选择 | Wrap | 行号


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆