default value

  • Thread starter Thread starter stephm
  • Start date Start date
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!
 
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
 
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!
.
 
Back
Top