Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2006, 06:31 AM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tabstrip controls

I have a TabStrip control with 2 tabs. The first tab (circulation) has a ListView showing all the movies in the database. The second tab (details) is suppossed to display the details of the movie. I want to code it in such away that as long as a movie is highligted in the ListView, when you click on the details tab, the details of the movie that was highlighted is shown. The same effect should be seen if I double click on a selected movie in the ListView. How can I code thatt?

 
Old July 11th, 2006, 11:03 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

For the first part, AfterUpdate of the list view, set all of the controls on the Details page. The controls are present for being filled in even when they are not visible. Then when the Details tab is selected, the already-updated controls will be presented.

For the double-click, in the event procedure do the same updating process, then set the Details tab as the active one.

Does that help?
 
Old July 12th, 2006, 03:49 AM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do I need to change the SELECT code to have a WHERE clause that refers to the selected item in the listView? If yes, how can I reference the selected item in a ListView. Currently, the listview is filled with records from the recordset and what is remaining is just to ensure that the details of a selected item are presented in the controls in the second tab.

Thanks

 
Old July 13th, 2006, 04:58 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Loop through the .items of the listview, and when you find the one where .selected = True, store the value in a variable.

Following that, as you build your SQL, in your WHERE clause, concatenate the value of that variable.





Similar Threads
Thread Thread Starter Forum Replies Last Post
TabStrip Part II dkr72 Excel VBA 1 December 7th, 2004 05:44 PM
TabStrip dkr72 Excel VBA 9 November 20th, 2004 05:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.