Solved Dropdown list

Springblossom

Member
Local time
Today, 08:48
Joined
Jan 18, 2022
Messages
55
Hello dear accessworld friends,

Could you please help me with a dropdown list, where by writing a word, all the possible results having that word in them, appears in the dropdown list?
 
Do a search on "FAYT" in this forum.
 
SELECT wordsearch.word
FROM wordsearch
GROUP BY wordsearch.word
HAVING (((wordsearch.word) Like '*' & [Forms]![Query1]![searchtext] & '*'));

Try the sql above, your combo box will be based on a query similar to it.

In the sample , you are selecting from a table called wordsearch, field called word

The form with the search text box is called query1, and the search text box is called searchtext.



Finally in VBA do the following
On the after update event of the search text box, you have to requery the combo box e.g
combobox1.requery
 
Private Sub ProjectName_Change()

If Nz(Me.ProjectName.Text) = "" Then
Me.Form.ProjectName = ""
Me.ProjectNameOn = False

ElseIf Me.cboProjectName.ListIndex <> -1 Then
Me.Form.ProjectName = "[ProjectName] = " & _
Replace(Me.cboProjectName.Text, "' ", """) & "' "
Me.ProjectNameOn = True
Else
Me.Form.ProjectName = "[ProjectName] Like '*" & _
Replace(Me.cboProjectName.Text, "'", """) & "*'"
Me.ProjectNameOn = True
End If
Me.ProjectName.SetFocus
Me.ProjectName.SelStart = Len(Me.cboProjectName.Text)


End Sub



In this code how can I show that the [ProjectName] is from a table called projects?
Please start using code tags and indentation. :(
 
if you can Upload your db, i will help you set it up.
 

Users who are viewing this thread

Back
Top Bottom