Default Value in Combo Box (1 Viewer)

rishi3881

New member
Local time
Today, 21:38
Joined
Jun 19, 2007
Messages
5
There is a unbound combobox in the form. Where Data Tab Contains following informations.
Row Source Type : Value List
Row Source : 2060;2062;2063;2064;2065
Default Value : 2064
--------------------------------------------------
Problem is,
When new value is selected from the combobox eg. 2063 this value should be assigned as Default Value till next value is not selected.
Thanks for any support.
The Row Source value is fixed (2060;2062;2063;2064;2065) and it will never change.

thanks for help
 

dcobau

Registered User.
Local time
Tomorrow, 02:08
Joined
Mar 1, 2004
Messages
124
there are probably better ways of doing this but how about:

1) create a small pop up form with a single field and make it invisible,
2) on the OnChange event of the cbobox assign the value selected to the field in the pop up form
3) refer to this field when the value is needed

Dave
 

rishi3881

New member
Local time
Today, 21:38
Joined
Jun 19, 2007
Messages
5
Any code that i can apply directly on OnChange event for the field?
 

boblarson

Smeghead
Local time
Today, 09:08
Joined
Jan 12, 2001
Messages
32,059
How about this -

In the AfterUpdate event for the combo box, you would put this:

Me.YourComboBoxName.Default = Me.YourComboBoxName
 

boblarson

Smeghead
Local time
Today, 09:08
Joined
Jan 12, 2001
Messages
32,059
Now, that won't hold when you close the database and come back. You could only do that if you change it in design mode OR if you create a table to hold the value and use a DLookup to set the default when the form loads and then rely on the code I gave you for the After Update event in that After Update event. Then, in the form's unload event update the table with the current value.
 

Users who are viewing this thread

Top Bottom