无法加载具有表值的组合框,然后使用列表进行编辑 [英] Can't load combo box with table value and then use list to edit

查看:84
本文介绍了无法加载具有表值的组合框,然后使用列表进行编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用表单来显示/编辑表查询中的一些记录。我可以获取我想要显示的值,但是我想使用一个组合框,如果需要,可以从另一个表中加载一个列表来编辑该字段。我可以从表查询中获取显示的值,我可以从另一个表中加载列表,但是当我尝试更改值时,它不允许我这样做。我昨天整天都在争吵,我尝试不使用控制源但是使用表中的默认值来加载未绑定的对象(这给了我#NAME?),我尝试设置记录集并根据表单数据进行突破(这给了我一个错误,说明表中的字段没有定义)。我甚至试图确定如何将记录集公开,以便我可以使用相同的查询加载它并通过它来获取运行其他查询所需的值。


所有这一切,有没有人知道如何从一个表中的组合框中放置一个值,并从另一个表加载下拉列表,允许您覆盖从Dropbox的值?根据您的回复,我将能够以编程方式更新我的表格,或者从表格中更新我的表格。


感谢您的帮助,


A. Brian Cogan,CPB

认证的QuickBooks ProAdvisor

I am using a form to display/edit some records from a table query. I can get the value I want to display, but I want to use a combo box that has a list loaded from another table to edit the field, if necessary. I can get the value to display from the table query, and I can load the list from the other table, but when I try to change the value it won''t allow me to do it. I fought with this all day yesterday, I tried not using a control source but using a default from the table to load an unbound object (this gave me #NAME?), I tried setting up recordsets and bumping through based on the form data (this gave me an error stating the field from the table wasn''t defined). I even tried to determine how to make a recordset public so I could load it with the same query and bump through it to obtain values needed to run other queries.

All of this aside, does anyone know how to put a value in a combo box from one table, and load the dropdown from another table that will allow you to override the value from the dropbox? Based on your response I will be able to update my table either programatically or have it occur from the form.

Thanks for your help,

A. Brian Cogan, CPB
Certified QuickBooks ProAdvisor

推荐答案

Brian,我们需要更多的信息和细节,而不是你的已提供:
Brian, we will need much more information and details other than that which you have provided:
  1. 组合框的属性,例如:名称,列数,控制源,列宽,绑定列等...
  2. 如何填充组合框:表名,查询,SQL语句等...
  3. 从另一个表中绘制值的代码。
  4. 所有其他相关代码。
  5. 显示表单的记录源。
  6. 您确定表单的记录源是否可更新?
  7. 等等。 。


组合框的属性,例如:名称,列数,控制源,列宽,绑定列等。 。

名称:品种
列数: 1
控制来源:这是其中一个问题。我用一个吗?或问题出在哪里?我想先填充它的字段是[Scale Tickets] .Variety
列宽:是空白的
列头:
行来源:这是问题的另一部分。我真正想要的是来自名为[ActivePrices]的查询中的值,其中包含不同的品种和相关的价格。我需要的只是品种。
来源类型:查询/表格
装订栏::1
限制列表:
允许值列表编辑:

如何填充组合框?我会喜欢使用查询ActivePrices。

从另一个表中绘制值的代码。 截至目前,没有代码。什么都没有用,所以我把它全部搞砸了。我希望重新开始。

显示表单的记录源。 我不确定你的意思。您是指填充表单的表的记录布局吗?表单的记录源名为ScaleTicketsQuery。

你确定表单的记录源是可更新的吗?我检查了一些其他字段,它不会让我更新其中任何一个。如何使记录集可更新?我可以不写任何代码吗?


请原谅这个愚蠢的问题,但是我没有写任何VBA代码,因为我很尴尬地说,1988年......我正在尝试重新编写QuickBooks的界面。


我不认为我在这里想要完成的事情有什么复杂的。我相信必须有一个简单的答案。我只是希望能够在加载时填充组合框并能够根据值列表进行更新。任何帮助将不胜感激。
Properties of the Combo Box such as: Name, Column Count, Control Source, Column Widths, Bound Column, etc...

Name: Variety
Column Count: 1
Control Source: This is one of the questions. Do I use one? Or is this where the problem lies? The field I want to populate it initially is [Scale Tickets].Variety
Column Widths: is blank
Column Heads: No
Row Source: This is another part of the question. What I really want here are the values from a query called [ActivePrices], which contains the different varieties and there associated prices. All I need in the list is the varieties.
Source Type:Query/Table
Bound Column::1
Limit to List: No
Allow Value List Edits:No

How is the Combo Box populated? I would like to use the query ActivePrices.

Code that draws the Value from another Table. As of this point there is no code. Nothing work, so I scapped it all. I am looking to start fresh.

Display the Record Source for the Form. I''m not sure what you mean by this. Do you mean the record layout for the table that is populating the form? The record source for the form is called ScaleTicketsQuery.

Are you sure the Record Source for the Form is Updatable? I checked some of the other fields and it won''t let me update any of them. How do I make the recordset updateable? Can I do it without writing any code?

Pardon the stupid question, but I haven''t written any VBA code since, I''m embarassed to say, 1988.... and I am trying to get back into it writing interfaces for QuickBooks.

I didn''t think there was anything complicated in what I am trying to accomplish here. I am sure there has to be a simple answer. I just want to be able to populate a combo box when it loads and be able to update based on a list of values. Any help would be appreciated.



我检查了一些其他字段,它不会让我更新其中任何一个
I checked some of the other fields and it won''t let me update any of them



这是问题似乎存在的地方。您是否有可能上传数据库或其中的一部分?此时,我需要实际看到发生的事情以及为什么记录源不可更新。

Here is where the problem seems to exist. Is there any chance that you can Upload the Database, or a subset of it? At this point, I need to actually see what is going on and why the Record Source is not Updateable.


这篇关于无法加载具有表值的组合框,然后使用列表进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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