Default display in combox

  • Thread starter Thread starter Gary Schuldt
  • Start date Start date
G

Gary Schuldt

How do I get a default value displayed in an unbound combo-box?

When I open the form, I'd like to be able to set an item from my
RecordSource to be displayed. When I click a cmdOK on that form, I'd like
that "default" to be the value of the combobox if the user didn't select
something different.

Thanks.

Gary
 
Hi Gary!
I guess you'll have to use VBA for your form's onLoad event.
You must insert these lines of code between "Sub... and ....End Sub"
procedure called when the form is being loaded.
Me.Combo1.Value = Dlookup("[Name of a column]","[Name of the table]", "set
of certain conditions to retrieve the default value")
 
Thanks, Michael!

My first application of the statement worked fine.

Gary

Michael said:
Hi Gary!
I guess you'll have to use VBA for your form's onLoad event.
You must insert these lines of code between "Sub... and ....End Sub"
procedure called when the form is being loaded.
Me.Combo1.Value = Dlookup("[Name of a column]","[Name of the table]", "set
of certain conditions to retrieve the default value")


Gary Schuldt said:
How do I get a default value displayed in an unbound combo-box?

When I open the form, I'd like to be able to set an item from my
RecordSource to be displayed. When I click a cmdOK on that form, I'd like
that "default" to be the value of the combobox if the user didn't select
something different.

Thanks.

Gary
 
Back
Top