473,732 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOw to UPDATE programatically

41 New Member
Good Morning

I have a table as noted below.

Schoolid num
Gradeid Num
TeacherFTE Num
Student_enroll Num
year text

The primary key is made up of gradeid, schoolid and year. The application loads two years worth of data. For example, for each record in 2008 there is another for 2009. Several of the schools require that a formula be applied to predict the next year's enrollment. My question is how to construct an UPDATE for just these schools. In other words, the enrollments for year 2008 for schools A and B need to be updated so that a formula is applied and the result of the formula is updated to the matching student _enroll records for the year 2009.

Data example
Schoolid Student enroll year gradeid
12 1003 2008 17
12 2004 2008 18
12 1123 2008 23

The records for the next year exist with 0 enrollments, I need a way to update the table so that I can update the student_enroll field for the year 2009 after applying a formula to the 2008 student_enroll number. Thanks for getting me started.

Patti
Mar 27 '08 #1
1 1126
dbpros
15 New Member
I would probably do this with a VBA recordset function.

You can use recordsets with criteria to select the desired records to get your calculations.

You can then use recordsets and the rs.Edit and rs.Update commands to update the desired records.

Hope this helps

http://www.db-pros.com
Mar 27 '08 #2

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

Similar topics

2
6784
by: Tom | last post by:
I have an unbound object frame on a subreport containing a chart linked to a chart in an Excel worksheet. I can open the subreport in design view, select the unbound frame, go to Edit - OLE/DDE Links, click on Links in the dialog that appears and click on the Update Now button and the chart updates. Can the above be done programatically at runtime? Can the above be done programatically before the subreport opens? Thanks!
2
5685
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm running a form/table that tracks transactions and I want to update a daily and monthly table at the end of each transaction based on the CustomerID <> CASH or <> CCARD. Which should give me only the accounts that charged products or services. I would like to do this as transparent as possible as not to alert my clerks to the update procedure. Is there a way to programatically open...
2
3709
by: Christopher | last post by:
Greetings, Fairly new to c# and Im looking for pointers on a few topics: Im curious as to general methods to update multiple rows in a database. Currently Im thinking of just allowing a user to update one row of data at a time and designing/building textboxes to allow them to enter this data. I would then use a method to insert this data. (sqlCommand) Is there a more efficient method of updating 10 rows of data at a time? Such
3
19370
by: Martin Horn | last post by:
Hi all, I am using VB2005 and the new data controls, which all work fine, except there is a situation where I want to add a new row to the database without using the 'AddNewItem' button on the BindingNavigator control; it has to be done programatically. This is the best I can come up with but it fails on line 3 with error 'Objects added to a BindingSource's list must all be of the same type.'
3
1920
by: ibiza | last post by:
Hi all, I am currently developing in asp.net 2.0 and I was at first impressed with the numerous login and user controls they provided to ease the task of managing users. But I am starting to think it's an hassle for certain tasks...here's my problem : I have created some users and successfully log them with the supplied
0
3367
by: JayD | last post by:
I am using Visual Web Developer (vb.net) and have a gridview in a form. I can update records using standard EDIT/UPDATE buttons. However, there are two fields in every record (called ModifiedBy and ModifiedDate) that I use to track who last changed data in a row and when. How do I programatically (vb.net) enter this information in the two fields. Right now they are template fields (EditItemTemplate) and I am using textboxes (TextBox1 and...
3
16698
by: Bob | last post by:
Hi, FrameWork 2.0 Quick and dirty job so I thought I would do it all on the UI as quick and easy as possible. I got the datagridview to display my Access databaseview by using the Datasources and dragging the exposed view onto the datagrid as per the help instructions I can't get edits to go back to the database. I have tried editing cells at the UI and also programatically. With a UI edit the pencil comes up and goes away when I move...
3
2448
by: Slower Than You | last post by:
I am trying to write an SQL UPDATE statement for an MSAccess table and am having some problems getting my head around it. Can anyone help? TableName: CustTransactions TransactionKey AutoNumber (Primary Key) CustomerID Long Integer (Non-unique index) AmountSpent Double CustSelected Boolean What I would like to do is, for all of the records in descending order
0
1161
by: HendrikVis | last post by:
Help! I have created a simple SQL database from the solution explorer (visual studio 2005). My table has a primary key assigned. I can manually add rows and programatically read the rows. I try to edit, add, or delete a row using the following code: (delete shown here) DataSet dataSet = new DataSet(); int count = sqlDataAdapterActivityLog.Fill(dataSet); DataTable table = dataSet.Tables; DataRow row = table.Rows; row.Delete(); if...
0
1052
by: jemitch0 | last post by:
I have a 2 column table that contains FK to other tables in my app. The 2 columns together form the PK for the table. I want to be able to update these values using a Detailsview, but can't get the update to work, the record does not update. I tried adding additional parameters to the Update Parameters of the SqlDataSource, then setting those params programatically, but still does not work. <asp:DetailsView ID="property_detail" ...
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.