Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Have a form that displays student information and the address. My table structure is as follows:

Student
    ID - PK - AutoNumber
    Name    - Short Text
    Age     - Int

Address
    ID - PK - AutoNumber
    Student ID - FK - Number
    Door No - Int
    Address - Text

Student table has student id. Address table has a FK which is Student ID. In my form I want the user to enter the student name and address information and this should be stored into multiple tables from this single form. ( I dont want to use sub form).

How can do the above? Do I need to write code in VBA and use unbound form?

Please provide inputs

share|improve this question
what you've tried ? – matzone Jun 3 at 10:13
tried creating the form using the form design and it puts a sub form. Another option I am trying is to have a save button and in the click handler do a sql insert of the student followed by sql insert of address. Use Vba code or macros to do this. Looking for feasibility without writing vba code. – user1264583 Jun 3 at 10:18
that's the point .. make some code based on that .. someone here can't help you when you have no code or achievement till you stuck .. – matzone Jun 3 at 10:21
not asking for any code. Just wanted to validate the approach as to whether i need to write vba code or there is any inbuilt access functionality that can enable this. thanks – user1264583 Jun 3 at 10:26
sorry .. your approach is right .. you just have to make it real .. cheers .. – matzone Jun 3 at 10:31

1 Answer

up vote 0 down vote accepted

Yes, you have to use VBA code or macros. Basically, you have to define the add,update and delete operations of the form. Define the "After Update" event, the "After Delete Confirm" and "After Insert" at the form level. Update your tables there. You might have to define other events depending on your needs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.