Forums

This topic is locked

Insert record to related table

Posted 14 Nov 2002 23:39:12
1
has voted
14 Nov 2002 23:39:12 Derran Williams posted:
Can any one help. I have a very basic database set up, two tables, one listing tasks and the other updates on those activites. What i want is to view all my activity in a master page, click on a link next to each activity and add a update to that activity. I have created the insert page for updates but i can get it to relate to the activities table. When i try it just says

'You cannot add or change a record because a related record is required in table 'task_tbl'.'

All i want is to add additional updates to each task, bearing in mind there may be more than one update to one task. Hope some one can help ive tried all i know.

cheers

derran

Replies

Replied 15 Nov 2002 02:41:05
15 Nov 2002 02:41:05 Dennis van Galen replied:
that error happens when you try to insert or update a record into the database where one field, as you described, has a relationship to another table. This field is either empty or out of range...
out of range meaning, you try to insert task 75 when there are only tasks 1 - 50 available.

best way to do it would be to query your tasks into a menu and add a pre-selected static option like "please select a task" at the top of the list, then you know that that if you get this error you forgot to select a task.

or more to the point, have one form with a text element and the list i described above and then you are off, type a name of person who does the task or make the text box another listbox and query in your employee names or ...

did that make sense ?

also make sure your relationship is one task to many activities.

With kind regards,

Dennis van Galen
Webmaster KPN Services
Financial and Information Services

Edited by - djvgalen on 15 Nov 2002 02:44:20

Reply to this topic