Auto fill combobox on a form

F

franky

Hello,

I created a touch screen application using MS Access 2000. I have a form
that has a bunch of buttons that look like a keyboard layout. I also have 3
combo boxes. When a user clicks on of the "keyboard buttons" the character
is put into the last screen.activivecontrol that is a combobox. This work...
However, the auto fill of the combobox is not occuring using the buttons but
works when typing in the combobox. How can I make this work?

Thanks in advance!

When the user selects on of the comboboxes here is the sub that is executed.
The FieldEntry string is a global form variable for keeping track of the
last combobox that had focus:

Private Sub ActiveEntryField()

Dim ctl As Control
Set ctl = Screen.ActiveControl

If ctl.ControlType = acComboBox Then
FieldEntry = ctl.Name
End If

End Sub

Here is the code behind one of the buttons :

Private Sub Command1_Click()
AddText (Me.Command1.Caption)
End Sub

Here is the sub that populates the text into the combobox:

Private Sub AddText(myText As String)
Me(FieldEntry).SetFocus
Me(FieldEntry) = Me(FieldEntry) & myText
End Sub
 
M

Maverick

I'm certainly not an Access guru, but I don't think you can activate the
autofill. The problem is that you aren't typing anything into the box... code
is palcing a value in it. There is a big difference.

What you would need to do, and how I do not know, is to force the dropdown
to expand and move to the closest match. It wouldn't be activating autofill;
it would be code that would do this.

I hope someone else knows how to make that magic work. Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top