use combo box

supiansyarif

New member
Local time
Tomorrow, 04:48
Joined
Apr 24, 2020
Messages
13
Daer All Master MS Access

for MS Access masters, I currently use MS Access 2010, and I want the steps to create a filter using the combo box on the form, I made the combo box inactive

thanks,
Supian
 

Attachments

  • Combo box.jpg
    Combo box.jpg
    203.4 KB · Views: 420
in your combo after update event put

Code:
me.filter="[code unik]='" & me.mycomboname.column(0) & "'"
me.filteron=true

note if your bound column is the same as the first visible column in your combo, you do not need .column(0)
 
alternative to the previous solution.
still on combo's AfterUpdate Event:

private sub combo_afterupdate
if me.combo.listindex > -1 then
docmd.applyfilter , "[code unik] = '" & me.combo & "'"
' if the visible value on combo is not the bound column:
'docmd.applyfilter , "[code unik] = '" & me.combo.Column(1) & "'"
else
' remove the filter
docmd.showallrecords
end if
end sub
 
alternative to the previous solution.
still on combo's AfterUpdate Event:

private sub combo_afterupdate
if me.combo.listindex > -1 then
docmd.applyfilter , "[code unik] = '" & me.combo & "'"
' if the visible value on combo is not the bound column:
'docmd.applyfilter , "[code unik] = '" & me.combo.Column(1) & "'"
else
' remove the filter
docmd.showallrecords
end if
end sub

Cant you tray the atttachment
 

Attachments

Users who are viewing this thread

Back
Top Bottom