Hi All,
I am creating a form for editing and adding data in an access 2007 database. I have a problem with a subform turning invisible if there are no records in it for the current record in the main form.
I'll first describe the part of the database in which the issue occurs:
The database has well-data in it. From many wells a set of samples has been taken for lab-analyses. The results of these analyses may be from samples taken from the groundwater, the soil or another type of matrix.
To be able to store this, I have a table with well data, and a table with analyses-data. These are related through the field BhId (Borehole ID). In the Analyses table there's a field called Matrix that tells where the sample has been taken (groundwater, soil, etc.).
This is how the form looks:
I have a main form built upon the well-data table. It contains a few tabs. On one of them, a subform is located that contains the analyses data. This subform contains tabs for a couple of different sets of analyses. The sets all are analyses for the well currently selected in the main form, but they have been filtered into different sets on the previously mentioned matrix field. Each matrix tab then contains a continuous subform with the related analyses.
It looks more or less like this:
Now, all this works well. I get the right analyses records in each matrix tab for the well selected in the main form. I can edit and add new records to the analyses table and the wells table.
There is one problem though: if a well does not have any associated analyses, the entire matrix tab does not show (or more likely: the subform in which the matrix tab is placed does not appear). Now, I do understand that there is nothing to edit, because there are no records. But I would like to be able to add new records to the analyses tabel for wells that have no analyses in them yet. I don't see a form for that now.
So, what can I do to solve this? How can I get the analyses subforms to show up empty when there are no records associated to the current well?
Any help will be greatly appreciated.
Best regards,
Martijn Senden.
I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams -
I am creating a form for editing and adding data in an access 2007 database. I have a problem with a subform turning invisible if there are no records in it for the current record in the main form.
I'll first describe the part of the database in which the issue occurs:
The database has well-data in it. From many wells a set of samples has been taken for lab-analyses. The results of these analyses may be from samples taken from the groundwater, the soil or another type of matrix.
To be able to store this, I have a table with well data, and a table with analyses-data. These are related through the field BhId (Borehole ID). In the Analyses table there's a field called Matrix that tells where the sample has been taken (groundwater, soil, etc.).
This is how the form looks:
I have a main form built upon the well-data table. It contains a few tabs. On one of them, a subform is located that contains the analyses data. This subform contains tabs for a couple of different sets of analyses. The sets all are analyses for the well currently selected in the main form, but they have been filtered into different sets on the previously mentioned matrix field. Each matrix tab then contains a continuous subform with the related analyses.
It looks more or less like this:
Code:
_________________________________________
| Main form |
| __________ ____ ____ |
| | analyses |____|____|________________ |
| | ______ ____ ____ | |
| | | soil |____|____|___________ | |
| | | | | |
| | |____________________________| | |
| |_____________________________________| |
|_________________________________________|
There is one problem though: if a well does not have any associated analyses, the entire matrix tab does not show (or more likely: the subform in which the matrix tab is placed does not appear). Now, I do understand that there is nothing to edit, because there are no records. But I would like to be able to add new records to the analyses tabel for wells that have no analyses in them yet. I don't see a form for that now.
So, what can I do to solve this? How can I get the analyses subforms to show up empty when there are no records associated to the current well?
Any help will be greatly appreciated.
Best regards,
Martijn Senden.
I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams -