Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS Access
 form populates PK when FK chosen
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Carveth Worth
Starting Member

2 Posts

Posted - 22 February 2001 :  11:51:33  Show Profile
I am trying to create an Access 97 database form in which some fields utilize a Primary Key(PK)/Foriegn Key(FK) relationship. I want a value from a table containing the FK(such as a person's name) to show in the combo-box. Easy enough. The problem is that I want a different value (such as the person's id#) to be inserted/updated into a different table based on the combo-box selection. The end result is that a user will not see the id#s being inserted/updated in the base table. They will only see the names associated with the id#s.

Is there any way to do this?

Doug G
Support Moderator

USA
6493 Posts

Posted - 22 February 2001 :  12:43:14  Show Profile
Sure, bind the data combo to the ID field as the first column of your combo, then the name as the second column of the combo.

In the format properties, set the first column width to 0. Your dropdown will show only names but the actual bound field will be the id's.


======
Doug G
======
Go to Top of Page

Carveth Worth
Starting Member

2 Posts

Posted - 26 February 2001 :  11:56:25  Show Profile
Thanks Doug! This is exactly what I wanted!

I am having one problem with it. Data updates and inserts work great. But I keep getting a "value you entered isn't valid for this field" error. I have mirrored the properties between the query used by the form and the table it updates, except the datatype. The table has a text datatype. The query (due to its definition) has both number and text datatypes for its two columns.

What am I missing?

I realized that I was missing the fact that the "Bound Column" is the one that determines the query's datatype. It was mismatching with the table's text datatype. Problem solved.

Thanks again Doug for your help.

Edited by - Carveth Worth on 26 February 2001 12:26:46

Edited by - Carveth Worth on 27 February 2001 13:55:27
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07