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

You are currently viewing the VB Databases Basics 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 April 6th, 2006, 10:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default DBCombo and DataControl

dtaInput is the main DataControl connecting to an Access database. dtaDescription feeds the DBCombo which exists to display a Description instead of the unfriendly DesciptionID. cboRecordType simply provides an integer 1, 2 or 3. The list of descriptions changes according to the content of cboRecordType, hence the three queries.

Private Sub dtaInput_Reposition()
  Select Case cboRecordType
    Case 1
      dtaDescription.RecordSource = "qryTest1"
    Case 2
      dtaDescription.RecordSource = "qryTest2"
    Case 3
      dtaDescription.RecordSource = "qryTest3"
  End Select
  dtaDescription.Refresh
End Sub

The above code works well, with one exception. When the Case changes, cboDescription displays the DescriptionID instead of Description BUT ONLY FOR THE FIRST TIME AFTER THE CHANGE. Continuing to move through the recordset with dtaInput is then ok until another Case change.

Any clues much appreciated. Many thanks.


Clive Astley
__________________
Clive Astley





Similar Threads
Thread Thread Starter Forum Replies Last Post
datacontrol.aspx example problem wendyhod ASP.NET 1.0 and 1.1 Basics 0 May 4th, 2005 09:48 AM
Chapter 2 datacontrol.aspx frogfur BOOK: Beginning ASP.NET 1.0 1 March 19th, 2005 12:59 PM
DataControl - Good or Bad? Ben VB Databases Basics 2 October 13th, 2004 03:47 PM
Chapte2 DataControl.aspx frogfur BOOK: ASP.NET Website Programming Problem-Design-Solution 0 February 11th, 2004 05:09 PM





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