Solved

dbcombo autosearch does not work

Posted on 1998-05-30
9
267 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 59
Restricting text box entry from \/:?<>"| 9 86
Macro which automatically sends attachment to Outlook 14 69
VBA error replacing data 6 39
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

770 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