访问问题“docmd.openreport”代码,请帮忙。 [英] Problem with access "docmd.openreport" codes, please help.

查看:102
本文介绍了访问问题“docmd.openreport”代码,请帮忙。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub Generate_report_text_Click()

如果IsNull(cbx_loan_table)= True则'如果cbx中没有选择那将执行此命令
MsgBox "您必须输入关键字。"否则,请输入"DoCmd.OpenReport""贷款表","acViewPreview","ITEMDESCRIPTION like"*" &安培; cbx_loan_table& " *'"
'打开报告称为"贷款表"其中ITEMDESCRIPTION字段
'包含cbx_loan_table组合框中的值

结束如果

问题是每次单击按钮时DoCmd.OpenReport都无法工作将出现一个弹出窗口,要求我输入'参数值',参数将是ITEMDESCRIPTION。我认为我的代码没有将ITEMDESCRIPTION注册为报告中的字段,请帮助我解决这个问题。

假设我输入参数"篮球"。我已经在我的组合框中选择了篮球已经报告将出现所有记录,其中有足球,游泳漂浮等项目在ITEMDESCRIPTION中
和男人有什么引号双引号和*表示他们叫什么?它不是表达式或运算符,所以我也读不了多少。谢谢你们这是我正在进行的学校项目。

来自Daniel Ker。
(VB新手)



结束Sub

Private Sub Generate_report_text_Click()

    If IsNull(cbx_loan_table) = True Then 'this command will be execuated if there is no selection in the cbx
        MsgBox "You must enter a keyword."
        Else
        DoCmd.OpenReport "Loan Table", acViewPreview, , "ITEMDESCRIPTION like '*" & cbx_loan_table & "*'"
        'Open report called "Loan Table" where the ITEMDESCRIPTION field
        'contains the value in the cbx_loan_table combo box

End If

The problem is the DoCmd.OpenReport cannot work everytime I click the the button a pop out window will appear asking me to 'Enter Parameter Value' and the Parameter would be ITEMDESCRIPTION.  I think that my codes don't register the ITEMDESCRIPTION as a field in the report, please help me solve this problem.

Lets say if I type in the parameter, "Basketball" and I already choose basketball in my combo box already the report will come out with all the records that have soccerball, swimming float etc. items in the ITEMDESCRIPTION

And guys what are the quotes double quotes and * means what are they call? it is not an expression or a operator, so I can't read up much on it either. Thanks guys this is for a school project that I am working on.

From
Daniel Ker.
(VB newbie)



End Sub

推荐答案

这似乎是VBA?请确认,我会将其移至您更有可能获得帮助的VBA论坛。

本论坛适用于.NET平台上的Visual Basic。
This appears to be VBA? Please confirm and I will move it to the VBA forum where you are more likely to get help.

This forum is for Visual Basic on the .NET platform.


这篇关于访问问题“docmd.openreport”代码,请帮忙。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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