I have a database with many tables called tbl_1, tbl_2, tbl_3, …, tbl_1000, all with the same structure e.g. (ID, field1, field2, etc), plus a main table with a different structure but with 1000 item entries (ID, data1, data2, tbl_ID), each one corresponding to one of the other tables. In the main table, ID is the primary key (1,2,3 etc), and when this key is selected in a Form, I want it to open a subform with the corresponding tbl_ID.
tbl_main
(ID, data1, data2, tbl_name)
tbl_1
(ID, field1, field2)
tbl_2
(ID, field1, field2)
tbl_1000
(ID, field1, field2)
So the problem is that in the subform I don’t know the name of the tbl_n I am going to display until the appropriate ID is selected in the main form. For example, if in the main form the selection is ID=23, I then want the subform to display tbl_23.
Can you please tell me step by step what I have to do to set up the Form and SubForm to accomplish this?
I am using LibreOffice 6.3.3.2
Thanks!
(Extra information)
Here is an example, grossly simplified. In this tbl_ASME contains information on collections of data called “volumes”. Details of each volume are contained in the files tbl_1, tbl_2, tbl_3, etc. Clearly all the data could be in one large table, (in this case tbl_n) but there would be a lot of redundant information. So I tried normalizing the tables.
As a matter of interest, in the full database, there are approximately 1000 volumes, each containing data on ancient documents, such as births, marriages and deaths from about 500 years ago. Each volume has about 30 columns of data specific to the volume (date, type, who, where, what, subcategories and so on). Most of the volumes have been photographed, with between 100 and 500 records (photos) for each volume. Thus tbl_1 will contain hyperlinks and other information about (say) 500 photographs for volume 1, while tbl_2 contains (say) 300 hyperlinks for volume 2, and so on. This means that I have literally hundreds and hundreds of tables. Access to the photographs in a volume are determined through a series of cascaded queries on tbl_ASME which end up with a volume number, say “n”. Then the system needs to open up tbl_n and display all the links to the photographs for that volume.
(A further matter of interest is that this system works perfectly well in a Microsoft Access application, but I now need to put the data online and so must have something that runs on a Unix server, such as LibreOffice)example.odb.