WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Creating a Default Value

 
   Home -> Office other -> Getting Started RSS
Next:  Desktop Shortcut will not open Web page  
Author Message
Wookawsh

External


Since: Aug 17, 2008
Posts: 7



(Msg. 1) Posted: Sun Aug 17, 2008 7:12 pm
Post subject: Creating a Default Value
Archived from groups: microsoft>public>access>gettingstarted (more info?)

Im trying to set the default value of several of my fields to the value of
one of my primary key fields.

Essentially I have a patient ID field called "STUDY ID" (primary key) that
is in One to many relationship with the STUDY ID field in other tables.
Instead of inputting this value over and over again in the various tables, I
would like to just enter it one time in a Form that I have designed. Then the
"ID" fields in the other tables will automatically get updated.

Im using the expression builder in the "Default Value" box, and putting in
=[STUDY ID] as the default value. When I try to save this, an error message
pops that that says that "STUDY ID" field cant be found.

Any suggestions would be appreciated. I have very limited coding ability.

Thanks

--
Lukasz
Back to top
Login to vote
John W. Vinson

External


Since: Jan 29, 2004
Posts: 6313



(Msg. 2) Posted: Sun Aug 17, 2008 8:45 pm
Post subject: Re: Creating a Default Value [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 17 Aug 2008 19:12:08 -0700, Wookawsh
<Wookawsh.TakeThisOut@discussions.microsoft.com> wrote:

>Im trying to set the default value of several of my fields to the value of
>one of my primary key fields.
>
>Essentially I have a patient ID field called "STUDY ID" (primary key) that
>is in One to many relationship with the STUDY ID field in other tables.
>Instead of inputting this value over and over again in the various tables, I
>would like to just enter it one time in a Form that I have designed. Then the
>"ID" fields in the other tables will automatically get updated.

A default value is NOT a good way to manage this. This PatientID in the
"other" tables is a "foreign key"; as such, you should probably never even
*see* it, much less enter it!

The normal way to enter foreign key values would be to use a Form for the
"one" side table (the patient table, it seems here), with one or more Subforms
for the related tables. If you set the Master and Child Link Field properties
of the Subform control to [STUDY ID] you'll keep the tables synchronized
without any need for code, or even for displaying the ID in the child form.

If you're using table datasheets to enter data.... well, don't. That's not
their function and they do not have the tools that you need.
--

John W. Vinson [MVP]
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Getting Started All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET