Page 1 of 1

Need to copy Field's name to field in another table - VBA

Posted: 20 Jul 2008, 17:06
by Tribble
I need help URGENTLY!

I have a data table in MS Access. There are many boolean fields. If the field has been ticked, I need to copy the field's name into a field as data in another table. I will also need to copy the applicant's ID to a field in that table too.

EG. I have P Smith who had an X-ray taken. So I tick yes under X-Ray. I now want that name (X-Ray) copied to a table called tblQuestionDetails field called [QNo]. I also need the [ApplicID] data copied to the [ApplicID] field in the other table (tblQuestionDetails).

I have 171 fields which can be ticked and would then need to be copied into the [QNo] field. The data must append to the table and not replace information. Yes - I know it is going to get really big.

Please help. This is really urgent.

Posted: 20 Jul 2008, 17:42
by Koko_Lion
I'm not very sharp on databases, but maybe somewhere in here can help

Link

Posted: 20 Jul 2008, 18:43
by Tribble
Unfortunately that isn't really helpful. I have tried some of the Access forums and also no help yet.

Perhaps with a very long winded action / append query. But then I would need to know how to remove the data from the additional table if someone accidentally ticks a box and then removes the tick.

Naah it has to be based on the -1 value of the check box.

Posted: 20 Jul 2008, 18:52
by Koko_Lion
Phew..sounds pretty difficult, sorry that link didn't help. I'll let you know if something comes to mind

Posted: 20 Jul 2008, 20:06
by Ron2K
Tribble wrote:But then I would need to know how to remove the data from the additional table if someone accidentally ticks a box and then removes the tick.
If you were using SQL Server, you could use a trigger to accomplish this. I don't think that Access (which is, let's face it, not the most robust of DBMSs out there) has this functionality though.

Posted: 21 Jul 2008, 05:49
by Tribble
I know - but there must be a way to write to a table - surely.