Set Combo Box to default value

R

rjinxed

New to Access and I know very little about VBA, but I'm using a Combo Box to
lookup records and want it to reset to the default value when the field
looses focus. Can this be done best using VBA code? Thanks in advance!
 
O

Ofer

On the Lost focus event of the combo try and write the code

me.ComboName = Me.ComboName.DefaultValue
 
R

rjinxed

That didn't seem to work, I get an error saying it can't find the macro
"me." Here is what I put for the Lost Focus event: me.Combo48 =
Me.Combo48.DefaultValue
 
O

Ofer

When you are on the Lost focus peoperty, on the right you can see a button
with three dots, click on it, and select code view, and type this line in the
code section.

If you type this code strait in the box of the lost focus event, access will
look for a macro in this name
 
R

rjinxed

That worked, thanks!

Ofer said:
When you are on the Lost focus peoperty, on the right you can see a button
with three dots, click on it, and select code view, and type this line in the
code section.

If you type this code strait in the box of the lost focus event, access will
look for a macro in this name
 
Top