Default value

G

Guest

Hi. I have a combo box: ComboSO that is working well. Then I have a field
called Spouse (Name: Spouse, Control Source: Spouse). I have Spouse's
Default Value as =Nz([ComboSO].[Column(1)]," ")

The reason I've done this is I have a field for Member Spouse (ComboSO). If
ComboSo is populated, I want the same data to automatically fill Spouse. If
the Spouse is not also a member (ComboSO is null), but there is a Spouse, I
want to be able to manually enter the spouse's name in Spouse.

My set up works as intented. But. When I create a new record, Spouse
appears as #Name? so of course I've done something incorrectly. How can I
have the functionality I need with Spouse and ComboSO without Spouse being
automatically populated with #Name? at a new record? Thanks!
 
A

Allan Murphy

Stephanie

Remove your default value for Spouse and in the AFTER UPDATE event of
ComboSO put the following code

me!Spouse=me!ComboSo.Column(1)
 
D

Douglas J. Steele

Rather than trying to use a default value, put code in the combo box's
AfterUpdate event to populate the Spouse text box.
 
G

Guest

Thanks- that did the trick!

Douglas J. Steele said:
Rather than trying to use a default value, put code in the combo box's
AfterUpdate event to populate the Spouse text box.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Stephanie said:
Hi. I have a combo box: ComboSO that is working well. Then I have a
field
called Spouse (Name: Spouse, Control Source: Spouse). I have Spouse's
Default Value as =Nz([ComboSO].[Column(1)]," ")

The reason I've done this is I have a field for Member Spouse (ComboSO).
If
ComboSo is populated, I want the same data to automatically fill Spouse.
If
the Spouse is not also a member (ComboSO is null), but there is a Spouse,
I
want to be able to manually enter the spouse's name in Spouse.

My set up works as intented. But. When I create a new record, Spouse
appears as #Name? so of course I've done something incorrectly. How can
I
have the functionality I need with Spouse and ComboSO without Spouse being
automatically populated with #Name? at a new record? Thanks!
 
G

Guest

Thanks for the help- perfect!

Allan Murphy said:
Stephanie

Remove your default value for Spouse and in the AFTER UPDATE event of
ComboSO put the following code

me!Spouse=me!ComboSo.Column(1)

--
Allan Murphy
Email: (e-mail address removed)
Stephanie said:
Hi. I have a combo box: ComboSO that is working well. Then I have a field
called Spouse (Name: Spouse, Control Source: Spouse). I have Spouse's
Default Value as =Nz([ComboSO].[Column(1)]," ")

The reason I've done this is I have a field for Member Spouse (ComboSO). If
ComboSo is populated, I want the same data to automatically fill Spouse. If
the Spouse is not also a member (ComboSO is null), but there is a Spouse, I
want to be able to manually enter the spouse's name in Spouse.

My set up works as intented. But. When I create a new record, Spouse
appears as #Name? so of course I've done something incorrectly. How can I
have the functionality I need with Spouse and ComboSO without Spouse being
automatically populated with #Name? at a new record? Thanks!
 

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