Default value for multi-select

  • Thread starter Thread starter Tellis2112
  • Start date Start date
T

Tellis2112

I'm sure there's an easy answer to this and it's just escaping me..

I have a form with a field in it that is multiselect that drops down a list
of possible users. I would like to have the default value be the current
user.

Now I do have a module in the opening form of the dbase that sets a static
value for the user logged in to the file. The value is CurrentUserRep().

Seemingly simple, I went to the properties tab for the multiselect fieldand
set the default value as CurrentUserRep(). Doesn't seem to be working. It
leaves the field blank.

Any help is appreciated. And thanks to all you guys and gals who read and
reply to these threads. You're the best!
 
I believe the only way would be to set it through VBA.

Something like:

Dim lngLoop As Long

For lngLoop = 0 To (Me.NameOfListbox.ListCount - 1)
If Me.NameOfListbox.ItemData(lngLoop) = CurrentUserRep() Then
Me.NameOfListbox.Selected(lngLoop) = True
Exit For
End If
Next lngLoop
 
Back
Top