Combo Last value as default / not saved

H

Hermann

Hi
My Name is Hermann. I have tried to find a solution for default values
in an Access program I have made to organize the daily management of
the vessel.
I have tried this method. I found your comment in internet Google
Groups.
Private Sub cboName_AfterUpdate()
Me.cboName.DefaultValue = """" & Me.cboName & """"
DoCmd.Save acForm, Me.Name
End Sub

When I have the property box open I can see that the default value
change when I selct new values from the drop down list, however if I
close the form without doing any changes in the property box the old
default value is still there, not the new one I selected
I found out if I change some settings like the Font to bold etc. the
new Default value was saved.

Please advice.
 
G

Guest

while the method to your end may be possible, I think there is an easier way.
Create a table for lookup values etc...
In this table make (at least) 2 column.. 1 LookupType and 2 LookupValue

For your purposes
put a value in the table... something like this.
LookupType LookupValue
MYFORM_CONTROL_DEFAULT Test1

In the form load event, change the default to the value in the table. on
the form if you want to change the defaule, just update the lookup table.
Simple

*** This method is how a lot of packaged software 'localizes' labels (Makes
labels appear in different languages). All label captions are looked up in a
table, based on the language users select..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top