从组合框填充的文本框不存储值 [英] textbox populated from combobox not storing value
问题描述
我的Access数据库出了问题,因为我是新手,我不知道是什么东西?
好的,这就是问题所在。
我有一个有Meds表的数据库,有两个字段。
1- Medication_Name
2-Concentration
在表格上我有一个Medication_Name的组合框(它有所有药物名称形成Medication_Name字段),以及浓缩文本框。我希望我的用户在选择特定的药物时,浓度文本框应该自己填充。所以,我正在玩它,我得到了那部分工作,但我遇到的问题是当浓缩的文本字段填充时,它不在主表中保存。有没有办法可以做到这一点?
请帮帮我。
谢谢
什么是'文本框的控件来源?
感谢您的回复。如果我把字段的名称放在控制源中它将保存在表中,但是如果我把这个= DLookUp(浓度,medquery1)放在控制源下我会得到结果,但它不会保存进入桌子。
它有点复杂的解释..
也看看这个,它很有帮助你。
私人Sub Medication_Name_Change()
''DoCmd.OpenQuery" medquery1"
Me!Concentration.Requery 结束Sub
这就是我在查询下的内容
SELECT Meds.Concentration
FROM Meds
WHERE(((Meds.Medication_Name)= [表格]![MainTable1]![药物名称]));
我需要帮助这个..
I am having a problem with my Access database, since I am new to this, I have no idea what is goign on????
okay here is the problem.
I have a database which has Meds tables, and has two fields.
1- Medication_Name
2-Concentration
On the form I have a combo box for Medication_Name (it has all the medication names form the Medication_Name field), and textbox for Concentration. I want my User when they pick the specific medication, the concentration textbox should get populated by itself. So, I was playing around with it, i got that part working, but the problem I am having is when the textfield for Concentration gets populated, its not saving in the main table. Is there a way we could do that?
please help me.
Thanks
What''s the control source for the textbox?
thanks for the reply. If i put the name of the field in the control source It will save in the table, but if i put this =DLookUp("Concentration","medquery1") under control source I will the result, but it will not save into the table.
its kind of complicated to explain..
take a look of this too, it migh help you.
Private Sub Medication_Name_Change()
'' DoCmd.OpenQuery "medquery1"
Me!Concentration.RequeryEnd Sub
and thats what i have under Query
SELECT Meds.Concentration
FROM Meds
WHERE (((Meds.Medication_Name)=[Forms]![MainTable1]![Medication Name]));
please I need HELP regarding this..
这篇关于从组合框填充的文本框不存储值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!