default value

S

stephm

Hi. I have ComboOther on my form that has a row source:
SELECT Member.MemberID, Nz([NickName],[FirstName]) & " " &
[LastName] AS [Member Name]

I want the default of field OtherName to be
ComboOther.Column(2) or in other words: Nz([NickName],
[FirstName]) & " " & [LastName]

I can't seem to get the default value. Thanks for any
ideas!
 
G

Guest

Hi, Stephm.

It is strange, because the Help on the DefaultValue property indicates that
it can be any string or expression, which would include any field or property
thereof, but I get the same result--nothing happens when the default value is
set to the column property.

The Column property, though, is zero-based--to refer to the second column,
use the index 1.

One solution is simply to use the AfterUpdate event procedure of the combo
box to set the textbox value to the desired one:

Me!MyTextbox = Me!MyComboBox.Column(1)

Hope that helps.
Sprinks
 
S

stephm

Thanks for the help! Perfect. Groan on "1"- I'm rusty!
Thanks
-----Original Message-----
Hi, Stephm.

It is strange, because the Help on the DefaultValue property indicates that
it can be any string or expression, which would include any field or property
thereof, but I get the same result--nothing happens when the default value is
set to the column property.

The Column property, though, is zero-based--to refer to the second column,
use the index 1.

One solution is simply to use the AfterUpdate event procedure of the combo
box to set the textbox value to the desired one:

Me!MyTextbox = Me!MyComboBox.Column(1)

Hope that helps.
Sprinks

stephm said:
Hi. I have ComboOther on my form that has a row source:
SELECT Member.MemberID, Nz([NickName],[FirstName]) & " " &
[LastName] AS [Member Name]

I want the default of field OtherName to be
ComboOther.Column(2) or in other words: Nz([NickName],
[FirstName]) & " " & [LastName]

I can't seem to get the default value. Thanks for any
ideas!
.
 

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