Help on .DefaultValue problem

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
 
D

Dirk Goldgar

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
 
A

Andrew

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)


.
 
D

Dirk Goldgar

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.
 
J

John Crighton

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)
 

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