Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i make the default value of a control=another on same form

Status
Not open for further replies.

crookedman

Technical User
Aug 24, 2001
2
I'm not much of an access user, so I hope this isn't just a simple oversight on my part. Here is the situation:

I have a form for entering enrollment data for my daughter's preschool. There is a tab for the child's data, another for the mother's data and another for the father's data. The form is set up so the child's data is entered first. Since in many cases, but not all, some of the data (address, etc) is the same for both parent's and the child, I would like many of the text boxes on the mother's tab and the father's tab to default to the data entered on the child's tab. Using the defaultvalue control doesn't seem to work, since it's all on one form. Any solutions will be appreciated.

--Douglas
 
Hi Douglas,

There are probably many ways to achieve this. Here's one idea.

On the 'After Update' event for the Child's address add the following code:

If IsNull(me.MotherAddress) then
me.MotherAddress = me.ChildAddress
endif

You don't want to overwrite any information already there so need to check that it is null first.

HTH

Jane
 
Thanks for the reply. This is very straight-forward and helpful. As you might know, for someone like me with *very* limited knowledge about database programing but a need to do something a little more complicated than catalogue my CD collection, MicroSoft's help files and knowledge base can provide a frustrating exercise in futility. I truely appreciate the help.

--Douglas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top