简体   繁体   中英

Append Query using Access 2003

I am helping a small school with their database which I created three years ago and that works fine. I am now creating a attendance register as a new feature to it and am struggling with the update query fields.

I have two tables and one append query which works well with the form I have created. I have combobox to filter the class to check the register which works well. The problem I am faced with is when running the query, it updates all 180 students and not the ones filtered per class.

I need to append the data only for the class selected. Thank You

Please help. Harry

It seems that you wish to only update or append the rows that match the combobox on your form. You can refer to an open form in a query in MS Access. With your append query in design view, under the field that you want to match and type in Form! followed by the name of your form, another dot or exclamation, and the name of your combo, say:

Forms!Form1!Combo0

In SQL View an append query would look something like:

INSERT INTO Table1 ( AText )
SELECT Table2.AText
FROM Table2
WHERE Table1.ID=[Forms]![Form1]![Combo0]

Similarly for an update query:

UPDATE Table1b 
SET Table1b.ADate = Date()
WHERE Table1b.ID=[Forms]![Form1]![Combo0]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM