Solved

Combobox click simulation

Posted on 2000-03-19
8
414 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

634 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