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

Get help on databases - MySQL, Oracle, Access, etc.
Post Reply
User avatar
Tribble
Registered User
Posts: 88465
Joined: 08 Feb 2007, 02:00
Processor: Intel Core i7-4770K CPU@3.50GHz
Motherboard: ACPI x64-based PC
Graphics card: GeForce GTX 780 Ti
Memory: 16GB
Location: Not here
Contact:

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

Post 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.
Image
Koko_Lion
Registered User
Posts: 13227
Joined: 25 Feb 2008, 02:00
Location: Relaxing in the savannah...
Contact:

Post by Koko_Lion »

I'm not very sharp on databases, but maybe somewhere in here can help

Link
Image
User avatar
Tribble
Registered User
Posts: 88465
Joined: 08 Feb 2007, 02:00
Processor: Intel Core i7-4770K CPU@3.50GHz
Motherboard: ACPI x64-based PC
Graphics card: GeForce GTX 780 Ti
Memory: 16GB
Location: Not here
Contact:

Post 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.
Image
Koko_Lion
Registered User
Posts: 13227
Joined: 25 Feb 2008, 02:00
Location: Relaxing in the savannah...
Contact:

Post by Koko_Lion »

Phew..sounds pretty difficult, sorry that link didn't help. I'll let you know if something comes to mind
Image
User avatar
Ron2K
Forum Technical Administrator
Posts: 9050
Joined: 04 Jul 2006, 16:45
Location: Upper Hutt, New Zealand
Contact:

Post 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.
Kia kaha, Kia māia, Kia manawanui.
User avatar
Tribble
Registered User
Posts: 88465
Joined: 08 Feb 2007, 02:00
Processor: Intel Core i7-4770K CPU@3.50GHz
Motherboard: ACPI x64-based PC
Graphics card: GeForce GTX 780 Ti
Memory: 16GB
Location: Not here
Contact:

Post by Tribble »

I know - but there must be a way to write to a table - surely.
Image
Post Reply