Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Combobox click simulation

Posted on 2000-03-19
8
Medium Priority
?
425 Views
Last Modified: 2013-12-25
I'm posting text to a combobox from a textbox during an  event on a cmdNext (Navigation button).
I have a click event firing when a selection is made in this combobox.(If I manually click in the combobox)
After the text is placed in the combobox is there anyway to simulate a click event to recognize the value in the combobox?
To simulate picking the text.
Thanks
fordraiders
0
Comment
Question by:Fordraiders
  • 4
  • 4
8 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 2633294
You can simply call "Combo1_Click" since it is also a regular procedure.
0
 
LVL 3

Author Comment

by:Fordraiders
ID: 2633560
emoreau,
The comboxes seem to be working.
However the events in the click event do
not seem to be firing.
I have a drill down sequence on both comboxes and after the click event in the second combobox a datagrid is being filled.
None of this is happening.
1. combox
 Private Sub cboNoun_Click()
    Dim db As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim sql As String
    'Me.Command2.Enabled = False
    Me.cboMod.Clear
   
    With db
        .CursorLocation = adUseClient
        .ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source =c:\program files\cribture\data\nomad.mdb"
        .Open
    End With
    sql = "Select * from ndxNounsModifiers where noun = '" & cboNoun.List(cboNoun.ListIndex) & "'"
                   
    With rs
        .Open sql, db
    End With
    Do Until rs.EOF = True
        cboMod.AddItem rs.Fields("modifier").Value
        rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing
    db.Close
    Set db = Nothing

End Sub


2. second Combox
Private Sub cboMod_Click()
Dim cnNN As ADODB.Connection
Dim rsTT As ADODB.Recordset
Dim STRCNN As String
Dim STRSQL As String
Dim tgValue As String
Dim x As String
x = "LENGTH"
Me.Command2.Enabled = True

' provide jet connection
    STRCNN = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source =c:\program files\cribture\data\nomad.mdb"
    Set cnNN = New ADODB.Connection
cnNN.Open STRCNN
    ' hook it all up guys new code from one table  nomad  stuff
    STRSQL = "Select Attribute, Value from ndxAttributes " & _
          "where noun = '" & cboNoun.List(cboNoun.ListIndex) & _
          "' and modifier = '" & cboMod.List(cboMod.ListIndex) & "'"
 Set rsTT = New ADODB.Recordset
    With rsTT
        .ActiveConnection = cnNN
        .CursorLocation = adUseServer
        .CursorType = adOpenKeyset
        .LockType = adLockOptimistic
        .Open STRSQL, , , , adCmdText
    End With
 
 Set Adodc3.Recordset = rsTT
 Set DataGrid1.DataSource = Adodc3.Recordset
 DataGrid1.Columns(0).Locked = True
 
 
 'PLACE A BUTTON IN THE CUSTYPE COLUMN
 DataGrid1.Columns(1).Button = True
 
END SUB



any suggestions?
fordraiders
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2633618
Place breakpoints in your events and check for the value inside:
cboNoun.List(cboNoun.ListIndex)
cboMod.List(cboMod.ListIndex)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:Fordraiders
ID: 2633641
emoreau,
Both are showing
cboNoun.List(cboNoun.ListIndex)  = ""
cboMod.List(cboMod.ListIndex)  = ""
fordraiders
0
 
LVL 3

Author Comment

by:Fordraiders
ID: 2633644
emoreau,
Both are showing
cboNoun.List(cboNoun.ListIndex)  = "" 
cboMod.List(cboMod.ListIndex)  = "" 

(cboNoun.ListIndex) both are showing -1
(cboMod.ListIndex)

fordraiders
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2633670
This is because you have nothing chosen in these combos!
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2633672
Since it is a combo box, you can use cboNoun.text (instead of cboNoun.List(cboNoun.ListIndex))
0
 
LVL 3

Author Comment

by:Fordraiders
ID: 2633941
emoreau,
Thanks
a million.
This has got me going!!!!
I still have other questions about the datagrid.
But that's another question!

I had this working using code from the rad tool appication.
But I needed to the combox bound to another recordset and the only way I knew to do this was to faked the combox into thinking I typed something into it.
To sort of sync the application from past values chosen.
Thanks again
Learned alot
fordraiders
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

782 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