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

Updating old record on creation of new record with same value in a field

2
Howdy!

I have a question that I have tried to approach a few different ways, but none of them seem to work. Long story short I have a table that tracks Assemblies, named tblRevisionSets, which have a SoftwareRevision, HardwareRevision, RevisionSetDate, and Current (I have as a short text field for yes/no, but can use yes/no type if it would help). What I would like to accomplish is that if a new record is created that references the same Assembly number, the new record be set to Yes for current, and any other records with the same Assembly number be switched to No, or Not Current. I'm thinking this would be based on the RevisionSetDate, but my tinkering hasn't produced much success. The ultimate goal in getting this to work is to also have it tie to another table/form which will pull the most current Revision Set for a given assembly automatically when adding inventory. Any insight, suggestions, or advice would be greatly appreciated.
May 20 '15 #1
3 1186
zmbd
5,501 Expert Mod 4TB
jshott
Sounds like this is your first database?
If so you would greatly benefit from reading the insights topic on normalization:
[Microsoft Access / VBA Insights Sitemap] > [Database Normalization and Table Structures ]

The yes/no field can be problematic if you have to move data to a larger database (( Why I stopped using Yes/No fields ))

What I don't see in your table [tblRevisionSets] is any reference to the "Assemblies" this would be one step.

Your next issue is the update... I think that you may not have the best database design here... I'll have to think that thru.
May 20 '15 #2
jshott
2
This is indeed my first database. I read the article 'Why I stopped using Yes/No fields', which is what inspired me to change it to a short text field. The full list of fields in the tblRevisionSets is as follows, in case it helps: RevSetID (auto), Assembly, SoftwareRevision, HardwareRevision, RevisionSetDate, RevisionNotes, and RevisionSetDate.
May 20 '15 #3
zmbd
5,501 Expert Mod 4TB
Ok,
If I understand it correctly, then you may not need the "current" entry unless one plans to go back in time :)

so your table
Expand|Select|Wrap|Line Numbers
  1. [RevSetID][Assembly][SoftwareRevision][HardwareRevision][RevisionSetDate][RevisionNotes]
Assumeing (yes ;-) ) that [RevSetID] is the primary key and that [Assembly] is the foreign key to your assembly data table. Then with each new record entry one would have a date associated with that entry so you could query against the [Assembly] and then max([RevisionSetDate]) to return your "newest" record entry based on the date. Your only catch here would be if there were two or more entries on the same day for the same [Assembly]...
May 20 '15 #4

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

Similar topics

2
by: Phil Powell | last post by:
I am having to update records in a table where the field will contain a substitution of another value.. something like this: I've been testing this and producing 0 results(I'm using 4.0.10...
5
by: Andrew | last post by:
Hi All, Have come across something weird and am after some help. Say i run this query where rec_id is a column of table arlhrl, select * from arlhrl where rec_id >= 14260 This returns to...
2
by: Bobbak | last post by:
Hello All, I am have created this form that allows the user to Add/Edit an Employees info. In it I have several Combo Boxes that forces the user to select one of the options containned in the...
1
by: Robin S. | last post by:
More clueless newbie questions... Table 1: "available specs" Table 2: "classes" A single form shows a single record from the table "classes". Each record in "classes" may contain several...
5
by: Mary Litten | last post by:
Hi - (This is my very first post) I have gotten to this point of registering to post because I have been spinning my wheels so long, I believe I am all caught up in the weeds. (and mud) I have...
3
by: meyo8185 | last post by:
hello guys.. i am new with javascripting and really lack of knowledge about it.. my lecturer asking me to insert or add the value that i already enter in the filed into a table locate really below...
31
by: MRHIGHSPEED | last post by:
Hi all. I'm new here and fairly new to building databases. Learned a lot in designing this one, but I am stuck on this one last expression. I'm trying to create a calculated control. The form is...
7
by: cmpcrand | last post by:
if 2 people are working on the same web site is it possible to be able to work on it Simultaneously so that if i for example was to change something it would change on the other persons screen...
1
by: Coll | last post by:
Hi - I'm trying to figure out how to append a record to a table and then open a form and display that record. My thought was to use the autonum primary key field (recordnum) and display the highest...
1
by: Eric IsWhoIAm | last post by:
I have three tables: Courses (Key is Autonumber Course Number, also have Text Course Name); Instructors (similar fields); and Courses and Instructors (have a combination of the four fields). ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.