如何使用组合框选择创建报告? [英] How to create report with Combo boxes selections?

查看:50
本文介绍了如何使用组合框选择创建报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:如何根据表单中多个组合框的值/选择创建报告?


我已经多次试过这个有几个失败,并使用了多个

代码尝试这个并且每个都不成功。


我将尝试解释我的数据库及其内容

表格和字段((PK)表示主键):

tblAssets:ID(PK),AssetNumber,SerialNumber,ModelName,ComputerName,

DeploymentDate ,活动,用户名,OfficeName,OSNAME

tblContacts:ID,公司,姓,名,初始,EMAILADDRESS,

JOBTITLE,商家电话,地址,城市,省,邮编,国家,用户名(PK)

ChargeCode,LocationCode

tblLocation:LocationCode(PK)

tblModel:ModelID(PK), ModelName


tblOfficeVersion:OfficeID(PK),OfficeName


tblOSVersion:OSName(PK)


所以最初我试图创建一个形式有两个组合框。 cboModel和

cboLocation以及一个打开rptModel的cmdbutton。打开后,我想

查看每个位置每个型号的数量。


Exaple:位置:OH01

型号:戴尔630 = 20

IBM M50 = 15

我尝试了多个代码但没有成功。请帮助我发布

这个问题3个星期,几乎没有帮助。并不是说人们已经尝试了b $ b但这似乎是一个很常见的问题。谢谢

的任何帮助,如有任何疑问请咨询。如果有帮助,我也可以提供一个

代码,但就像我说我尝试了各种不同的代码而

没有成功。谢谢!

解决方案


我已经多次尝试过几次失败并使用了多个代码来尝试这个并且每个都不成功。



你在尝试什么不起作用?


tblContacts:ID,Company ,LastName,FirstName,Initial,EMailAddress,JobTitle,BusinessPhone,Address,City,State,Zip,Country,Username(PK)



使用主键的用户名( PK)意味着您的表结构,因此数据库设计不正确,需要完整的修订。这是什么不起作用?有关设计表和创建关系的信息,请参阅数据库规范化和表结构


所以最初我试图创建一个表单...



你不能创建一个表单?或者您无法创建带有组合框的表单?


请告诉我们您的工作原理。然后,你已经尝试过什么那并不工作,比如,"我的报告始终是空白的"或"我的报告显示的所有记录,而忽略我的组合框"或"我的组合框不要为工作和QUOT; 。


好的 - 1.)我使用用户名的原因因为我的主要关键是因为它链接到tblAssests。这样,计算机资产通过用户名链接到用户。


好​​的,我第一次尝试这个时使用了以下代码On Click。为cmdApplyFilter:

<跨度类= codeLink 的onclick =模糊(此,this.parentNode.parentNode,的getChildren( this),true);>展开 | 选择 | <跨度类= codeLink 的onclick = 自动换行(在此);>裹 <跨度类= codeDivider> | <跨度类= codeLinkonclick =LineNumbers(this);>行号


在获得表单/组合框之前,您无法获得正确的报告。


第一个问题出现在cboLocationCode中。组合框中的下拉列表显示相同位置的多个值。



当然可以。您的查询

展开 | 选择 | Wrap | 行号


Question: How do I create a Report based off the values/selections of mutliple combo boxes in a form?

I have tried this several times with several failures and have used multiple
codes to try this and each has been unsuccesful.

I will try to explain my database and its contents
Tabels and Fields ((PK) indicates the primary Key):
tblAssets: ID(PK), AssetNumber, SerialNumber, ModelName, ComputerName,
DeploymentDate, Active, UserName, OfficeName,OSName
tblContacts: ID, Company, LastName, FirstName, Initial, EMailAddress,
JobTitle, BusinessPhone, Address, City, State, Zip, Country, Username(PK)
ChargeCode, LocationCode
tblLocation: LocationCode(PK)

tblModel: ModelID(PK), ModelName

tblOfficeVersion: OfficeID(PK), OfficeName

tblOSVersion: OSName(PK)

So initial i have tried to create a form with two combo boxes. cboModel and
cboLocation and with a cmdbutton that open rptModel. Upon opening I want to
see how many of each model is at each location.

Exaple: Location: OH01
Model: Dell 630 = 20
IBM M50 = 15

I have tried multiple codes with no success. Please help I have been posting
this problem for 3 weeks with very little help. Not that people have tried
but it seems that this is an issue that isnt covered very often. Thank you
for any help and if there are any questions please ask. I can also provide a
code if that helps, but like I said I have tried various differant codes with
no success.Thanks!

解决方案

I have tried this several times with several failures and have used multiple codes to try this and each has been unsuccesful.

What are you trying that does not work?

tblContacts: ID, Company, LastName, FirstName, Initial, EMailAddress, JobTitle, BusinessPhone, Address, City, State, Zip, Country, Username(PK)

Using Username for a Primary Key (PK) implies that your table structure, and therefore the database design is not correct, and needs a complete revision. Is this what doesn''t work? See Database Normalization and Table Structures for information about designing tables and creating relationships.

So initial i have tried to create a form with ...

You cannot create a form? Or you cannot create a form with comboboxes?

Please tell us what you have that works. Then what you have tried that doesn''t work, for example, "My Report is always blank", or "My report shows all records, and ignores my comboboxes", or "My comboboxes don''t work".


Okay- 1.) the reason I use "username" as my primary key is becuase it links to the tblAssests. This way a computer asset is linked to a user by the username.

Okay the first time i tried this i used the following code "On Click" for cmdApplyFilter:

Expand|Select|Wrap|Line Numbers


You can''t get the report right until you get the form/comboboxes right.

The first problem is in the cboLocationCode. The drop down list in the combo box shows mutliple values of the same location.

Of course it does. Your query

Expand|Select|Wrap|Line Numbers


这篇关于如何使用组合框选择创建报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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