PC Review


Reply
Thread Tools Rate Thread

default value doesn't stick

 
 
Bill H.
Guest
Posts: n/a
 
      28th Jun 2005
I set a default value for a combo box when a change is made to the combo
box. The idea being that when the form is opened again, the combo box will
have the last value selected.

Problem is, it don't work! It always "remembers" the first one I selected
after manually clearing out the default value, but when it puts one it, it
never remembers.

huh?

This is what I have:

Private Sub Site_Select_Combo_AfterUpdate()
Me!Site_Select_Combo.DefaultValue = Me!Site_Select_Combo.Column(0)
End Sub

Do I somehow have to tell the form to "save" this default value?


--
Bill


 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      28th Jun 2005
Yes, you do. Add acSaveYes to your close statement
DoCmd.Close acForm, FormName, acSaveYes.

Technically, changing the default value of a control is a design change.
What you need to also be aware of is if any other changes have been made you
don't want to keep, you will have to deal with that.

"Bill H." wrote:

> I set a default value for a combo box when a change is made to the combo
> box. The idea being that when the form is opened again, the combo box will
> have the last value selected.
>
> Problem is, it don't work! It always "remembers" the first one I selected
> after manually clearing out the default value, but when it puts one it, it
> never remembers.
>
> huh?
>
> This is what I have:
>
> Private Sub Site_Select_Combo_AfterUpdate()
> Me!Site_Select_Combo.DefaultValue = Me!Site_Select_Combo.Column(0)
> End Sub
>
> Do I somehow have to tell the form to "save" this default value?
>
>
> --
> Bill
>
>
>

 
Reply With Quote
 
Bas Cost Budde
Guest
Posts: n/a
 
      28th Jun 2005
Defaultvalue defines what value the bound control takes upon navigation
to a new record.
If your combobox is unbound, you can consider storing the value in some
table, and retrieve (and assign) it on form_load

Bill H. wrote:

> I set a default value for a combo box when a change is made to the combo
> box. The idea being that when the form is opened again, the combo box will
> have the last value selected.
>
> Problem is, it don't work! It always "remembers" the first one I selected
> after manually clearing out the default value, but when it puts one it, it
> never remembers.
>
> huh?
>
> This is what I have:
>
> Private Sub Site_Select_Combo_AfterUpdate()
> Me!Site_Select_Combo.DefaultValue = Me!Site_Select_Combo.Column(0)
> End Sub
>
> Do I somehow have to tell the form to "save" this default value?
>
>


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autologon set, but doesn't stick Terry Pinnell Windows XP Customization 3 28th May 2009 04:20 PM
Notification doesn't stick to screen edge when taskbar not at de default locatio Willem Rekvelt Spyware Discussion 3 21st Mar 2005 11:39 PM
Internet Explorer Default Browser Setting doesn't 'STICK' across reboots-IDEAS??? Hammer Toe Windows XP General 0 13th May 2004 04:41 PM
Changing Default Homepage Doesn't "Stick"` Larry Bohen Windows XP Internet Explorer 2 29th Nov 2003 11:55 AM
default printer doesn't stick... Brad Pears Microsoft Windows 2000 Terminal Server Clients 1 5th Sep 2003 08:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:46 AM.