|
-
May 11th, 2001, 01:06 AM
#1
Inserting data into database
I doing a project on online exam. There are two tables question table and subject table(Access database). In the subject table there are two fields sub_id and sub_name. In the question table there is sub_id field. In the dataentry screen there is a combo box of subject name. I want that while data entry when the user selects the subject name from the combobox the corresponding subject id should be entered in the question table.
I will be thankful if some one could suggest some code to solve the above query.
-
May 11th, 2001, 04:08 AM
#2
Re: Inserting data into database
Try this using a recordset
INSERT INTO QUESTIONS (SUBJECT_ID)
VALUES (
SELECT SUBJECT_ID FROM SUBJECTS
WHERE SUBJECT NAME = '<subject_name>');
Hope this helps
Andrew
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|