Reputation: 559
tldr: I want to create a form where specific fields from specific records are displayed based on filters or parameters. I do not want to use a subform or multiple item form.
the context: I am creating a database with information about different countries. My table Indicators (picture 1) contains country names, indicators names (e.g. Population, GDP, ...) and the respective values. I will collect data on the same indicators for every country. I want to create a form where I can select a country, and then display the values of the indicators are for that country (picture 2). I do not want to use a multi item form, because I want to create a visually appealing layout.
I have made a sketch of my data table
And the form I want to create
EDIT: Actually the form should look more like this, i.e. not a tabular layout.
I would be greatful for any suggestions how to build such a form.
Upvotes: 2
Views: 2620
Reputation: 11637
You can start with the form wizard to generate a simple data-bound form from your table. Then you can change it to show one record at a time, make all the controls read-only, and add a combo box to select the country and add a little VBA event handler to the combo box so that whenever its selection changes, the form navigates to the record for that country. Of course, in a form you can customise the layout to show indicators in any style you want. So this approach should fulfill all your needs.
Upvotes: 1
Reputation: 91376
With very little effort, I can get the following form and subform:
A little more tampering with the layout, and you can have exactly what you want.
To fill in various boxes, you can use DlookUp and you can use a recordset to write to your textboxes, but it is all quite messy.
Upvotes: 0