473,320 Members | 1,976 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,320 software developers and data experts.

How to add details from form to existing row in the access table?

In MS Access, I have a table Student with a primary key studentId and another column Hours. I am creating a new form in access called enterHours.

When I add data in the form and the studentId is not present in the table, it should create a new entry in the table.

But when the studentId is already present in the table, it should add the number of hours to the existing number of hours in the table. How do I do this?
Apr 13 '16 #1
3 2744
NeoPa
32,556 Expert Mod 16PB
For a new student you enter the data in a new record and for an existing one you find the record first then update it.

Maybe you're making this more complicated than it needs to be?
Apr 14 '16 #2
Because the studentId is primary key.You can give a datetime value to the column
Apr 14 '16 #3
NeoPa
32,556 Expert Mod 16PB
Selidev:
You can give a datetime value to the column
While that's actually true, it doesn't have any bearing on the question at all.

@gmgoutam.
However, it did lead me to read the question again and realise that, however obscurely the question was phrased, what you're after is actually to enter a delta rather than entering a new total value. This can be done with a bit of code in the AfterUpdate event of an unbound TextBox control on your form. The code would add the delta just entered to the value already in the record. The control would only be enabled for existing records as there's no point in adding an extra value to a new record.
Apr 14 '16 #4

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

Similar topics

2
by: Lee Falataco | last post by:
I have the tables set up in Access, viewing in column format on ASP pages but now the company wants the schedule reports to be in a wall-calendar type format. I've searched and found calendar...
4
by: JJ | last post by:
Hi, usually, I'm not using MS servers, but I have a big problem with a Access table. I should create a web application for a Historical Dipartment. They have created a populated a Access...
5
by: premmehrotra | last post by:
I am using Microsoft Access 2000 and Oracle 9.2.0.5 on Windows 2000. When I export a table from Access to Oracle using ODBC I get error: ORA 972 identifier too long I think the error is because...
1
by: VMI | last post by:
I have a filled datatable and I need to copy this data into an Access table with exactly the same table structure. Can I do this without having to run an Insert query for every line of the...
1
by: jmb | last post by:
I need to move data stored in an xml file to an MS Access 2000 table. I have a VB.net (created within Visual Studio.Net 2003) windows form that reads the xml data to a dataset and displayed in a...
1
by: fishmore | last post by:
MS Access question: I have made an access form with unbound control source fields and have written a Macro that will make a new record and store the data from each unbound field in a table. This...
15
by: OfficeDummy | last post by:
Hello all! I searched the Internet and this forum for a similar problem, but I found no help... Also, I'm a complete newbie to the fascinating world of programming, VBA and Access, so my question...
13
by: magickarle | last post by:
Hi, I got a pass-through query (that takes about 15 mins to process) I would like to integrate variables to it. IE: something simple: Select EmplID from empl_Lst where empl_lst.timestamp between...
9
by: dombrost | last post by:
Hi all. I am total newbie to Access so any help is greatly appreciated. I am creating a simple database in Access 2003 that captures details of an operation event. I created a form for the user...
1
by: HiGu | last post by:
I have two tables which can be represented by this query (I have made this query the Recordsource of the form): SELECT tblrcmtask.id, tblrcmtask.rcmtask,tblrcmtaskoptions.id,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.