View Full Version : setting a field of one table from other table


maheswari
09-09-2001, 03:39 AM
hi all,

I'm trying to put one transaction say library. I want to issue one book to one student from one form, transaction. At the same time, I want to update the master table as issued. How to write my code please help me with some sample code.

in transaction form, i'll be showing the book number and book name, which is available in the master table . The link field is book number.

Will it be flexible, if i do the Code builder in the Modify design of specific field of form design. ? Please suggest and help me out with some answers.

Rich
09-09-2001, 06:26 AM
Use a query to display which books are issued.

Pat Hartman
09-09-2001, 07:56 PM
I would suggest the following five tables:

tblStudent (this table may already exist in another application. Link to that table if possible)
StudentId
other info

tblBook
ISBN (primary key)
Title
Publisher
etc.

tblAuthor
AuthorId
FirstName
LastName
etc.

tblBookAuthor
ISBN (primary key field 1) (foreign key to tblBook)
AuthorId (primary key field 2) (foreign key to tblAuthor)

tblBookCopy
BookCopyId (autonumber) (primary key)
ISBN (foreign key to tblBook)
StudentId (foreign key to tblStudent) (may be null if book is in the library rather than being issued to a student)
IssuedDate

maheswari
09-09-2001, 08:03 PM
hi friend,

I just having the forms with what u said. Now, if I issue one book to the student, automatically the status of the other table, master status field should be changed to Issued.

That is , while coming out of that particular form record field, the other table record should get updated.

how to do with that ?

Pat Hartman
09-10-2001, 12:51 PM
If you used the structure that I suggested, the status field is not necessary and only one table needs to be updated. Once the StudentId is added to the tblBookCopy, the book is "issued". What other table would you want to update?