Is it possible to autofill fields in access using SQL to code?
-
Hi, I'm working on a project that uses access to create a database using SQL. Here is the code that I am using to create one of the tables: CREATE TABLE Exercise_Classes ( Class_ID AUTOINCREMENT(1, 1) PRIMARY KEY, Exercise_ID INTEGER REFERENCES Exercises (Exercise_ID), Date_of_Class DATE, Time_of_Class TIME, Instructor_ID INTEGER REFERENCES Instructors (Instructor_ID), Member_ID_If_Applicable INTEGER REFERENCES Members (Member_ID), Surname TEXT, Forename TEXT, "Liked?" VARCHAR (1) ); Is there a way to make it automatically enter in the Surname and Forename fields when a member id is entered? Thanks
-
Answer:
There is no need to write the Surname and Forname in the Exercise_Classes table, because you're already linking to the Member_ID. You can use a look-up combo-box to retrieve the corresponding member name. Otherwise what you intent to do will duplicate the storage of member name, and so you need to update two records each time the name is updated.
S at Yahoo! Answers Visit the source
Other answers
Duplicating information like this is a bad idea...it goes against the concept of data normalization and can lead to inconsistent data if the name is changed one place but not another. Since you have participants who aren't members, you could store the names here this way (iwc Member_ID would be NULL)...and make the name fields NULL if Member_ID is populated. This should solve the data inconsisency problem and you can easily get the member name if you need it.
TheMadProfessor
Related Q & A:
- How to convert my SQL query to MS Access query?Best solution by Stack Overflow
- How to restrict access to a sql server database from Azure?Best solution by Stack Overflow
- How to connect to SQL using SSL?Best solution by Stack Overflow
- Is it possible to make life-size mannequins using paper mache?Best solution by Yahoo! Answers
- Is it possible to ban someone on PS3 using a tree patch?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.