View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dan dungan dan dungan is offline
external usenet poster
 
Posts: 411
Default Populate combobox with sql from DAO

Hi,

I neglected to mention that I'm not using a userform--the control
object are directly on the worksheet.

I'm running the code from a command button click event.

Textbox2 holds the search criteria:

Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If TextBox3.Value = "" Then
If KeyCode = 13 Then
TextBox3.SelText = Replace(TextBox2.Text, "-", "")
End If
Else
Exit Sub
End If
End Sub

Textbox3 holds the search criteria with dashes removed

Then I search the database

Combobox2 should hold the results of the query.

Thanks,

Dan