Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How reset to DEFAULT VALUE (combo box)

Status
Not open for further replies.

gazolba

Programmer
Dec 4, 2001
167
US
I have set a Default Value for a combo box. The user has made some other selection. Now I need to reset to the default value without specifying it again. How?

As usual MS Access help is useless.
 
How are ya gazolba . . . . .

To my knowledge you can't. Ya have to specify, but you can respecify the Default in VBA. This will not change your initial Default as specified in design view.

Note: The Default Value is and Index from 1 to the number of rows in the combobox.

You'll have to determine where in your code to place the following:
Code:
[blue]Me!YourComboBoxName.[purple]DefaultValue[/purple] = [purple]Index[/purple][/blue]



cal.gif
See Ya! . . . . . .
 
gazolba

Are you trying to override the user's selection? If so, then is there a reason to allow the user to make a selection?

Otherwise, you might consider capturing the user's entry before updating and ask the user whether to save.

Cheers
Bill
 
I was hoping I could just reset the default value rather than having to respecify it, but thanks. My default values are kept in tables so its a pain.
 
gazolba . . . . .

If you'd like, just supply the default table and field names on the form, and I'll work up the code for ya. You could stick it in a Command Button or activate it as you like.

cal.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top