Solved

dbcombo autosearch does not work

Posted on 1998-05-30
9
265 Views
Last Modified: 2008-02-01
I try to use a dbcombo in the same way I did before with a combo box. The dbcombo is connected with an access database an works properly so far. But if I like to search an entry by typing into the edit-field nothing happens (it works very well with a combo box). Is this another MS-bug or are there any parameters I did not set? (I work with VB 5 - Beginners Edition).
Thanks for Answers!  
0
Comment
Question by:sokrates053098
  • 4
  • 4
9 Comments
 
LVL 8

Expert Comment

by:Helicopter
ID: 1462099
Have you set the match entry property to 0-dblBasicMatching?
0
 

Author Comment

by:sokrates053098
ID: 1462100
There's no difference in behaviour changing the match entry property. In the database are more then 300 entries (names from a to z). I can type into the edit field whatever I want - the list field does not change - allways shows the first entries of the database. Newertheless, thanks for the hint.

0
 
LVL 18

Expert Comment

by:deighton
ID: 1462101
All I can think of is - Is your list case sensitive e.g. your first entry is 'andy' say, because of capitals you might key a Z and find lower case z.

I got a DBCombo to work and search the list in VB4 32-bit.  Here is the text version of my controls - it may help you spot what is missing from yours

Begin VB.Data Data1
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "D:\AUTO_4\Sortcode.mdb"
      Exclusive       =   0   'False
      Height          =   735
      Left            =   1440
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "SORTCODE"
      Top             =   4800
      Width           =   2535
   End

 Begin MSDBCtls.DBCombo DBCombo1
      Bindings        =   "dbcombo.frx":0716
      DataSource      =   "Data1"
      Height          =   315
      Left            =   120
      TabIndex        =   3
      Top             =   2520
      Width           =   3015
      _Version        =   65536
      _ExtentX        =   5318
      _ExtentY        =   556
      _StockProps     =   77
      ForeColor       =   0
      BackColor       =   16777215
      MatchEntry      =   1
      Style           =   2
      ListField       =   "SCSTCD"
      BoundColumn     =   "SCSTCD"
   End
0
 

Author Comment

by:sokrates053098
ID: 1462102
Thank You deighton, but there's no case sensivity. Here is a list of my Controls (don't mind the syntax, it's just typed from the object window):
DataKunden Data
      BOFAction = 0
      Connect=Access
      DatabaseName=C:\Projekte\Rahmen\Kunden.mdb
      DefaultType=2
      EOFAction=0
      Exclusive=False
      Options=0
      ReadOnly=False
      RecordsetType=0-Table
      RecordSource=Kunden

DBCombo1 DBCombo
      DataBindings=""
      DataField=""
      DataSource=""
      BoundColumn=""
      IntegralHeight=True
      ListField=Name
      RowSource=DataKunden
      Locked=False
      MatchEntry=0
      Enabled=True

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 18

Expert Comment

by:deighton
ID: 1462103
I notice you are using a table type recordset (RecordsetType = 0) in the Data - I changed this om mine and I got the same problem.

I think you need RecordsetType = 1  (dynaset)
0
 

Author Comment

by:sokrates053098
ID: 1462104
Deighton, you are right! But unfortunately I have to use the index-property which is not available with a recordset of the type dynaset. Thank you for your support. Please leave another note, so I can grade your answer (I pushed the wrong button after reading your message). By the way, I can't find any documentation about this coherence. Should this be a bug?
0
 
LVL 18

Accepted Solution

by:
deighton earned 100 total points
ID: 1462105
Repeat of answer as requested.

I notice you are using a table type recordset (RecordsetType = 0) in the Data - I changed this om
      mine and I got the same problem.

      I think you need RecordsetType = 1  (dynaset)

- you probably already know this but - Note a dynaset should give you all the functionality of an indexed table and more using findfirst instead of seek.  I'll try and find out why a table doesn't work.
0
 
LVL 18

Expert Comment

by:deighton
ID: 1462106
I think a table doesn't work because of the limitations of searching tables - I couldn't find any documentation about this.  I tried

Private Sub Form_Activate()                'THIS DOES NOT WORK EITHER!!!
    Data1.Recordset.Index = "MyIndex"
End Sub

Private Sub DBCombo1_KeyPress(KeyAscii As Integer)
     Data1.Recordset.Seek ">=", Chr(KeyAscii)
End Sub

but this had no affect!  It is definitely a failing on the part of VB
0
 

Author Comment

by:sokrates053098
ID: 1462107
Not the only one!
Thanks a lot - I'll manage it with dynasets.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now