Visual Basic的新功能和我在公式中的沟通问题。 [英] New with visual Basic and i have communication problem in a formular.

查看:53
本文介绍了Visual Basic的新功能和我在公式中的沟通问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是VBA的新手,我对创建的公式有一个很大的问题:Plantview。


我有一个带有Combibox的Formular:Plantname 和 列表框:TypofMachine1,


列表框:TypofMachine2


我已经定义了一个查询:Query1 define,其中colums Plantname,Typofmachine,Blockname。


我的目标是:


我希望如果我在我的公式Plantview中的Plantname中选择一个值并选择Block 1,我将在Listbox中: TypofMachine1,来自Query1的所有值。


这是我的代码,但我有一条错误消息:用户的define typ未定义


我认为它无法识别图书馆,但我如何在我的程序中调用该库。在java中,我知道我必须使用import。


代码: 

 Private Sub Block_1_Click ()
Dim qdf As ADO.Querys
Dim sSql As String
qdf = CurrentDb.QueryDefs(" Query1")
sSql =" SELECT qdf.Parameters(Typofmachine) "
sSql = sSql& "WHERE(((((qdf.Parameters(Plantname))= Me.Liste9.Value)AND((qdf.Parameters(Blockname))='Block 1'))<> False))"
DoCmd.RunSQL sSql
End Sub

亲切的问候,




解决方案

你会得到的在与VBA关联的论坛中对VBA问题的最佳回答,例如


http://social.msdn.microsoft.com/forums/en/isvvba/threads


在Visual Basic中发布的VBA问题的答案。网络论坛可能会产生误导。



hi everybody,

i am a new in VBA and i have a big problem with a created formular:Plantview.

I have a Formular with a Combibox: Plantname  and  Listbox: TypofMachine1,

Listbox: TypofMachine2

I have define a query: Query1 define, which colums Plantname, Typofmachine,Blockname.

My objective is:

i want that if i choose a value in the Plantname in my formular Plantview and choose Block 1, that i will have in the Listbox:TypofMachine1, all the value from Query1.

Here is my code but i have a error message: the define typ of user is not define

I think it is not recognize the library but how can i call the library in my program. In java i know for exemple that i have to use import.

Code: 

Private Sub Block_1_Click()
Dim qdf As ADO.Querys
Dim sSql As String
qdf = CurrentDb.QueryDefs("Query1")
sSql = "SELECT qdf.Parameters(Typofmachine)"
sSql = sSql & "WHERE (((((qdf.Parameters(Plantname))=Me.Liste9.Value) AND ((qdf.Parameters (Blockname))='Block 1'))<>False))"
DoCmd.RunSQL sSql
End Sub

Kind regards,

解决方案

You will get the best response to a question about VBA in a forum that is associated with VBA, such as
http://social.msdn.microsoft.com/forums/en/isvvba/threads

Answers to VBA questions posted in a Visual Basic .Net forum might be misleading.


这篇关于Visual Basic的新功能和我在公式中的沟通问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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