473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Updating Tables After Event - Help!!

Hi,

i have this situation:

[Table] called 'RAP Courses'
[Table] called 'RAP Course CEQ Demands'

for each course there may be up to 140 demands (basically where the students are coming from) which is why i haven't included the demands as a static field in the Courses table - would look too much like a spreadsheet and lots of reduntant data.

I currently display the courses in Datagrid view with the demands embedded into it so when i press the + sign, i can see their demands.

Each course has a maximum capacity, and each course demand specifies how much capacity it needs.

I want to be able to have it so that when i view these two tables in the dataset fashion, i can change the course demand capacity and it automatically updates the fiend in table [Courses] called 'Spare Capacity'.

I know this can be done with a query and all this can be done with views made up of queries - but the trouble is, if ii use queries in a one-many relationship - i cannot edit any details on the 'one' side of the relationship meaning i cannot change things like 'Course Start Date'.

Here is my line of code i have so far for the 'After Update' on the [Course Demands] subform:

CurrentDb.Execute "UPDATE [RAP Courses] set [RAP Courses].[SPARE] = (sum(ALLOCATION) FROM [RAP Course CEQ Demands] WHERE [RAP Course CEQ Demands].[COURSE ID] = [RAP Courses].[COURSE ID])"

it doesn't work


Any help is greatly appreciated!
Jan 22 '08 #1
1 939
Okay, sorry for this:

i have discovered this is the correct code:

CurrentDb.Execute "UPDATE [RAP Courses] set [TEST] = (SELECT sum(ALLOCATION) FROM [RAP Courses CEQ Demands] WHERE [RAP ID] = [RAP Courses].[COURSE ID])"

However this does not work in access - it says "This needs to be an updatable query"

Any suggestions?

Thanks,

Chris
Jan 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ian N | last post by:
I have a website which puts customers into different groups, depending on the referrer they can see certain products. So for example if the referrer code = 1, they'll only be able to see the...
1
by: GKINLEN | last post by:
Help please I'm sure this simple but I'm new to Access. I have a table that needs a field updating from a calculated text box on an import form. How do get the record in the table to contain the...
1
by: Michael Thomas | last post by:
Hi everyone I have a database which I use to keep track of stock for the company that I work for. We are a retail chain with 8 locations at present and a head office. I need to keep track of...
0
by: drjmwebb | last post by:
I am using Access 2000/Windows 2000 on a Novel network I have a multi-user program that tracks documents and their holders. There are three primary tables tblHolders, tblDocuments and a link...
10
by: erick-flores | last post by:
Hello all I have been trying to look for the answer to my question doing some search in the groups but no luck. I have linked a table using ODBC. Then I made a copy of the link table to my local...
4
by: image77 | last post by:
how can i mirror a single table in server1 and server2 while getting the updates in real time?say tbl_plot is updating in server1 and also in server2 simultaneously?need help.
2
by: notsosavy | last post by:
Each month I will be updating a table in my database using data from a spreadsheet. I thought that I could just Copy/Paste from the spreadsheet and Ctrl A/Ctrl V and paste the info into the table. ...
2
by: majortool | last post by:
I work for a company where I do quality assurance. We get a spreadsheet every week of the curent employees where I work. What I need to do is import this spreadsheet every week and update my...
0
by: madlan | last post by:
Hi All. Could someone give me some advice on reporting progress from a zip extraction using the DotNetZip Library? I'm not an experienced programmer so having trouble understanding this. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.