Macro to open a form showing all information of selected item

ListBoxFilter_withPushButton.odb (749.7 KB)
I took the liberty of using Renel LOB “ListboxFilter.odb”, which seems to be working quite well, to exemplify my need to create a new macro that allows me to open a form showing a specific record of the table in which it is based.

I created a new form “FrmFilms” to enter and view all the records from the main table “TFilmsSeries”, which may have an undetermined number of fields (or columns).

And I created an action button on the “FilmsSeries” form, to open “FrmFilms” in the selected record, whose “FilmSerieID” record from the “TfilmsSeries” table corresponds to the value of the “fmt-IDFilmSerie” field of the “FilmSeries” form.

In other words: this database allows me to select a letter and list all the movie names that start with that letter. This is great, but not enough!

Now, with the list of film names organized alphabetically, starting by the letter I chossed, I want to open the form I created “FrmFilms” and see all the information about the film I selected.

If you open the form “FilmsSeries”, you’ll see a yellow action button “OpenFilm”. What I need to create is a macro for that button to open the form “FrmFilms” showing all the information of the selected film.

My question is: Is this possible? Can somebody help me? Thanks in advance.

Yes. Start with this thread, wich was begun 3 days ago.

Here
Base Macro - Click on Table Row to Open Record
there is a sample DB: OpenFormFromGridSelection.odb
from @Ratslinger I think will suit you.
After you set up the ordered TableControl from TFilmsSeries
CustomersGrid in sample
you should be able to open FrmFilms in the selected record
CustomersEdit in sample.
 
Take notice you don’t need form’s row as in the above mentioned thread.
You only need to open the form filtered by first letter
and in your source (for the Form) can ORDER BY < name > if you want it.
Or, better, do it all in the SQL Command for Data Source. To do this also employ the Filter Table Method

  1. Main - Filter Table where you enter your LIKE criterion;
  2. Sub Form = TFilmsSeries.