我正在处理我的第一个 Access 2010 数据库,并且在编辑从查询返回的记录集时遇到了问题。
我有两张表,“drugs”和“warehouse_stock”。在“药物”中,我有药物的名称。在另一张表中,我有相应的信息。对于那些在“药品”表中的药品,药剂师将管理它们的数量和其他相对值,例如每种药品的输入数量和特定的有效期。药剂师可以将相同的药物信息导入“warehouse_stock”,但有效期不同。
“warehouse_stock”中的每一行数据都以active_substance/strength/strength_type/dosage_form为特征。这四个值在“药物”中的一行数据中必须相同。药剂师将能够更新现有行数据的 curr_date、in_quant、out_quant_expiry_date 和品牌(来自“warehouse_stock”)并导入“drugs”中存在的新数量的药物。
我现在的查询是:
SELECT warehouse.active_subs,
warehouse.strength,
warehouse.strength_type,
warehouse.dosage_form,
warehouse.curr_date,
warehouse.in_quant,
warehouse.out_quant,
warehouse.expiry_date,
warehouse.available_stock,
warehouse.brand,
warehouse.ID
FROM drugs
RIGHT JOIN warehouse
ON ( drugs.active_substance = warehouse.active_subs )
AND ( drugs.strength = warehouse.strength )
AND ( drugs.strength_type = warehouse.strength_type )
AND ( drugs.dosage_form = warehouse.dosage_form )
WHERE ( ( ( warehouse.active_subs ) LIKE
"*" &
Forms!Pharmacy.form!pharmacy_warehouse_stock_Subform.form!warehouse_stock_act_sub & "*" )
AND ( ( warehouse.strength ) LIKE
"*" &
Forms!Pharmacy.form!pharmacy_warehouse_stock_Subform.form!warehouse_stock_strength & "*" )
AND ( ( warehouse.strength_type ) LIKE
"*" &
Forms!Pharmacy.form!pharmacy_warehouse_stock_Subform.form!warehouse_stock_strength_type & "*" )
AND ( ( warehouse.dosage_form ) LIKE
"*" &
Forms!Pharmacy.form!pharmacy_warehouse_stock_Subform.form!warehouse_stock_dosage_form & "*" ) );
有没有办法使结果可更新?
在此先感谢您的任何建议!
齐诺纳斯