Help on .DefaultValue problem

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

I have a Combo Box Called [Account Name]. Whant I want to
do is I want the field to be blank untill some one selects
something from the list, then that will be the default
value for new record untill some one else selects
something differant, and so one. Is there a way to do that?

Thanks, Andrew
 
Andrew said:
I have a Combo Box Called [Account Name]. Whant I want to
do is I want the field to be blank untill some one selects
something from the list, then that will be the default
value for new record untill some one else selects
something differant, and so one. Is there a way to do that?

Thanks, Andrew

Use code in the control's AfterUpdate event along the lines of:

Private Sub Account_Name_AfterUpdate()

With Me![Account Name]
.DefaultValue = """" & .Value & """"
End With

End Sub
 
I did just like you said, but it did not work, But when I
OPen a new record, and try to select something, It will
not let me select anything. when I close, and Open that
same record, then I can select something.. is there
something more


-----Original Message-----
I have a Combo Box Called [Account Name]. Whant I want to
do is I want the field to be blank untill some one selects
something from the list, then that will be the default
value for new record untill some one else selects
something differant, and so one. Is there a way to do that?

Thanks, Andrew

Use code in the control's AfterUpdate event along the lines of:

Private Sub Account_Name_AfterUpdate()

With Me![Account Name]
.DefaultValue = """" & .Value & """"
End With

End Sub

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Andrew said:
I did just like you said, but it did not work, But when I
OPen a new record, and try to select something, It will
not let me select anything. when I close, and Open that
same record, then I can select something.. is there
something more


-----Original Message-----
Andrew said:
I have a Combo Box Called [Account Name]. Whant I want to
do is I want the field to be blank untill some one selects
something from the list, then that will be the default
value for new record untill some one else selects
something differant, and so one. Is there a way to do that?

Thanks, Andrew

Use code in the control's AfterUpdate event along the lines of:

Private Sub Account_Name_AfterUpdate()

With Me![Account Name]
.DefaultValue = """" & .Value & """"
End With

End Sub

I don't follow your description, but plainly something must be going on
that I don't understand. Please report these properties of the combo
box:

Name
Control Source
Row Source
Bound Column
Limit To List
After Update

Please post the complete code from the form's class module, by copying
and pasting it into your reply.
 
I think I understand...

When you enter data in to a new record, the default value is applied to the
field. Changing the default value property of a field after the record has
been created will make no difference to the content of the field.

I think to achieve what you want to do, you need to actually set the field's
value as opposed to it's default value.

John C.

Dirk Goldgar said:
Andrew said:
I did just like you said, but it did not work, But when I
OPen a new record, and try to select something, It will
not let me select anything. when I close, and Open that
same record, then I can select something.. is there
something more


-----Original Message-----
I have a Combo Box Called [Account Name]. Whant I want to
do is I want the field to be blank untill some one selects
something from the list, then that will be the default
value for new record untill some one else selects
something differant, and so one. Is there a way to do that?

Thanks, Andrew

Use code in the control's AfterUpdate event along the lines of:

Private Sub Account_Name_AfterUpdate()

With Me![Account Name]
.DefaultValue = """" & .Value & """"
End With

End Sub

I don't follow your description, but plainly something must be going on
that I don't understand. Please report these properties of the combo
box:

Name
Control Source
Row Source
Bound Column
Limit To List
After Update

Please post the complete code from the form's class module, by copying
and pasting it into your reply.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top