Computing.Net > Forums > Database > Field Question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Field Question

Reply to Message Icon

Name: NZIBelChris
Date: July 9, 2006 at 18:08:54 Pacific
OS: XP Media Center
CPU/Ram: 2 GB Ram
Product: HP Pavilion
Comment:

OK, here's my question. I have a unbound field on a form called fldSubcontractor. This auto-fills based on fldEquipmentID. This works fine - here is my control source:

=DLookUp("[fldSubcontractorID]","tblEquipment","[fldEquipmentID] = Form![fldEquipmentID]")

The field fldSubcontractorID from the tblEquipment table is linked to a query. The first field of the query is the primary key field, which is an AutoNumber field, and the second field is the 3-letter abbreviation for the subcontractor. My properties for this are set to 2 Columns, 0";1" Width, and the Bound Column is 2. The data type for the fldSubcontractorID field is Text. I did this because I want the 3-letter abbreviation for the sub to show on the form instead of the primary key field. However, I know this is not how I should do this. The bound column in my query should be the primary key field, and the data type for the fldSubcontractorID should be Number so that I can set up my table relationships properly.

How can I configure this so that I can set the bound column as the primary key in the query but display the abbreviation on the form? Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Tanis
Date: July 10, 2006 at 06:47:57 Pacific
Reply:

You don't have to have your primary key as number? You can easily set the primary key in table design to any field you choose. Just remember that the data in the primary key field should not be duplicated. If you do want to make your primary key an autonumber field, then just add a new field to the table and make it the primary key. You cannot set up a primary key through a query, unless it is a make table query or create tbale SQL

David


0
Reply to Message Icon

Related Posts

See More


Access 97 - Save as HTML Local datasource advice n...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: Field Question

MS Access Question www.computing.net/answers/dbase/ms-access-question/63.html

automatically fill related fields www.computing.net/answers/dbase/automatically-fill-related-fields/227.html

field not updating www.computing.net/answers/dbase/field-not-updating/220.html