Unanswered: How to populate one table column based off another [newbie]
Hello. I'm fairly new to databases, I've done some work on making basic Access databases with multiple tables and using SQL to populate/edit/remove entries. Please forgive me if this question has been up before.
Now I am tasked with creating an Access database based off an Excel document. In the Excel sheet some columns were automatically populated using standard "=C1+D1" logic. However I have no idea how to make that happen in Access!
I have attached a file for you to visualize what I mean. I would like for the column "Klar" to be populated by the values from "Datum" and adding a week.
In SQL that would be something like
UPDATE [Order] SET [Order].Klar = Datum+7;
Can this be done automatically?
That worked perfectly, thanks a bunch. I know it's probably taking the easy way out for now, but that link you gave me seemed to be quite a hefty read
I'd like to know why you would consider this method to be "the wrong thing to do", if you don't mind.
This seems like a great place, I'll stick around for a while as I'm sure I'll have other questions in the near future.
Because it seems easy in the first instance but turns out to be much harder in the long run. Have a read of the document. It is a hefty read - that is why it is worth reading Some people (including some posters on here) reject quite a few of the tenets of normalisation. That's fine - but you should understand first of all what you are rejecting.
The big problem is what happens if Datum changes. Should Klar change to reflect it (in which case storing a value for Klar is wrong) or should Klar remain as it is (in which case storing the value is quite correct).
Remember that I am not simply saying "don't do that" and leaving you out on a limb. I am saying "Do something else instead".
I have a related question but I'm having trouble phrasing it. My Access is in Swedish and I'm not familiar with all the terms in English.
Right now my main table consists of normal input fields, a primary key number and fields connected by number to other tables, using the wizard thingy where instead of selecting "number" or "text" you select another table to associate with (see picture in original post for relationships).
Now, by using the code pootle flump so kindly gave me I can change the numerical value of a column:
This works fine for changing normal input fields on the main table. But when changing the reference to other tables the code gets "ugly". Let's say I have a sub table with the following information: keyID=1 text="firstRow", keyID=2 text="secondRow". Now by using the main table in the same manner as before I can change what is being presented by changing the reference, for example from "firstRow" to "secondRow":
Me!Kund.Value = 2
But that isn't good coding. If for some reason the keyID is changed in the sub table then one would have to re-do all the code with new numbers.
Is it possible to do it in a smoother way? Or am I just barking up the wrong tree?