How to update a table from form

eujeong

New member
Local time
Today, 16:06
Joined
Feb 5, 2014
Messages
6
Hi, I am a novice in Access World.
I need a help.
What I need to do is updating a table from a form.

I have two tables. tblStudent and tblRegister

tblStudent: StdName, StdID(PK), StdAddress, StdPhone, StdMajor
tblRegister: RegID(autonumber, PK), StdID, StdName, StdAddress, Course,
Credit

I made a form with tblRegister.(frmReg)
I made Combo box for StdID to autofill StdName and StdAddress.
I want to automatically update tblStuent when I put new StdID, StdName and StdAddress in frmReg. (I used NotInList VBA(?))

I tried Afterupdate event and Insert into thingy....but actually I don't know
what I need to do. Please help me out.
 
You have problems because you have normalization errors in your data structure.

Once you understand normalization (search for it) your problem will go away.
 
To expand on Galaxiom's advice--normalization is the process of properly setting up your tables to avoid certain issues. The one you've run into is storing redundant data.

StdName and StdAddress shouldn't be in both of your tables. They should only be in tblStudent, then when you need to reference data from both tables you create a query and join your tables by StdID.

Again, this isn't an issue to solve by coding, but one to solve by properly structuring your tables. Google "normalization".
 
Thanks a lot!!! I will try to remove the redundancy.
However I still don't know how to use SQL (JOIN ?).
Could you please explain how to write the SQL code(?) for my case?:o
 
Last edited:

Users who are viewing this thread

Back
Top Bottom