> Hi,
> I want to reset the default value of a combo box everytime someone
[quoted text clipped - 6 lines]
> Thanks,
> Using A2k.
You cannot save a change in a combo box property unless you change it
in Design View.
I would suggest you create a table with one field and one record.
Field Name NewDefault Set it's datatype to whatever the
datatype is of the combo box bound column.
Table Name tblDefault
to store whatever the last selected value is (in the Combo AfterUpdate
event)
' First change the default value for use while this form is still
open.
Me!ComboName.DefaultValue = Me!ComboName
' Then save the value to the table.
CurrentDb.Execute "Update tblDefault Set tblDefault.NewDefault = " &
Me.ComboName & ";",dbFailOnError
The above assumes the bound column is a Number datatype.
Then DLookUp that value when you next open the form (in the Form's
Load event):
Me!ComboName.DefaultValue = DLookUp("[NewDefault]","tblDefault")
You do know, I hope, that the DefaultValue will only come into play
for new records?

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
ken - 16 Dec 2005 17:18 GMT
>You do know, I hope, that the DefaultValue will only come into play
>for new records?
Yes I know this...
I was hoping there would be another way other then making a tblDefault.
I wonder if I can use globals maybe? But I think they will be lost
after you close the form too.... I'll have to play with it.
Thanks for your help.
Rick Brandt - 16 Dec 2005 17:30 GMT
> > You do know, I hope, that the DefaultValue will only come into play
> > for new records?
[quoted text clipped - 6 lines]
>
> Thanks for your help.
If you need the default value to persist between form sessions you could put it
into a global variable. Some prefer to use controls on a hidden form for this
(global variables not being very stylish these days).
If you need the default value to persist between application sessions then you
should store it in a table and retrieve it when the form opens.

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com