How to create text fields dynamically?

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

Was this solution helpful to you?

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:

Just Added Q & A:

Find solution

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.