Need Help with coding Tabstrips

  • Thread starter Manuel and Manuela
  • Start date
M

Manuel and Manuela

greetings to all
I have a case here
I have a database with 20 names and i want to display them
(each name) in a tab to control data of every one.

What is the code to develop this task?

any help will be apreciated.
thanks

Manuel and Manuela
 
R

Rick Brandt

Manuel and Manuela said:
greetings to all
I have a case here
I have a database with 20 names and i want to display them
(each name) in a tab to control data of every one.

What is the code to develop this task?

I'm assuming you mean you have a table with 20 records with each row corresponding to
a person or name and it sounds like you want to see different records from this table
depending on which tab page you are looking at.

Tab controls would ordinarily be used to divide up all of the controls for a single
record to better organize them or to make better use of the available real estate on
the form. In addition, they are sometimes used to show data from different tables
altogether by placing subform controls on them. What you are asking for is therefore
somewhat unusual, but it can be done.

If you include a column in your table (I'll call it ID) holding a number field and
assign the field the numbers zero to 19, you can then use the index number of the
TabControl pages to filter the RecordSet. Just create a standard form with the
controls laid out the way you want them. Then add a TabControl object. The controls
will not be placed on the TabControl pages, but rather will reside on the form itself
so you will see them no matter which Tab Page you select. Size the TabControl so it
*appears* as if the controls are actually on the tab pages.

Add additional pages until you have 20 altogether. These pages will have an index
value of zero to 19, exactly corresponding to the numbers you assigned to your rows.
All that is left is to put code in the Change event of the TabControl that looks
similar to. . .

Me.Filter = "ID = " & Me!TabControlName.Value
Me.FilterOn = True

You should see that each time you change the tab page, that a different record from
the table is filtered on and displayed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top