473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Including a Blank Field in a Key

Hi, I have a table where two fields will make up the primary key. In
a few cases the second field will be blank. When I try to append the
existing data into the keyed table I get the message that it cannot
append a null value into the keyed field.

Is there any way to set this up to allow the nulls in that second
field?

Thanks for any assistnace with this.

Robbie Bollinger
Nov 12 '05 #1
4 1898
Nulls not allowed in key fields...no way around that. Change the PK for you
table to fields that reflect the true nature of the data and that will not
be null.
Nov 12 '05 #2
ro*****@hotmail.com (R Bolling) wrote in message news:<6e**************************@posting.google. com>...
Hi, I have a table where two fields will make up the primary key. In
a few cases the second field will be blank. When I try to append the
existing data into the keyed table I get the message that it cannot
append a null value into the keyed field.

Is there any way to set this up to allow the nulls in that second
field?

Thanks for any assistnace with this.

Robbie Bollinger


Robbie: Ran into this myself recently, and had solved it this way:
Don't use a multi-field key.

Make a numeric field as you PK. Programmatically increase the ID
number (of course don't use AutoNumber). Then, open the Indexes
display (right next to the PK toolbar button) and manually create a
new index.

In the Index Name field, enter "SecondaryKey" (or whatever you want).
Enter your first field name on that same row. Enter the second in the
next row. Move back up to the row above, and then, in the bottom half
of the pop-up, change "Unique" to Yes, and "Ignore Nulls" to Yes.

You can't ignore nulls on the primary key, but any others are
perfectly acceptable. Hopefully this works for your project.

Anthony.
Nov 12 '05 #3
"Anthony Cuttitta Jr." <ac*******@railvan.com> wrote in message
news:66**************************@posting.google.c om...
ro*****@hotmail.com (R Bolling) wrote in message news:<6e**************************@posting.google. com>...
Hi, I have a table where two fields will make up the primary key. In
a few cases the second field will be blank. When I try to append the
existing data into the keyed table I get the message that it cannot
append a null value into the keyed field.

Is there any way to set this up to allow the nulls in that second
field?

Thanks for any assistnace with this.

Robbie Bollinger


Robbie: Ran into this myself recently, and had solved it this way:
Don't use a multi-field key.

Make a numeric field as you PK. Programmatically increase the ID
number (of course don't use AutoNumber).


why 'of course'? Then, open the Indexes
display (right next to the PK toolbar button) and manually create a
new index.

In the Index Name field, enter "SecondaryKey" (or whatever you want).
Enter your first field name on that same row. Enter the second in the
next row. Move back up to the row above, and then, in the bottom half
of the pop-up, change "Unique" to Yes, and "Ignore Nulls" to Yes.

You can't ignore nulls on the primary key, but any others are
perfectly acceptable. Hopefully this works for your project.


Yes, assuming that's what he wants. Robbie actually hasn't told us enough
really.
Nov 12 '05 #4
"rkc" <rk*@yabba.dabba.do.rochester.rr.com> wrote in message
news:EF*******************@twister.nyroc.rr.com...

"Mike MacSween" <mi******************@btinternet.com> wrote in message
news:3f*********************@pubnews.gradwell.net. ..
"Anthony Cuttitta Jr." <ac*******@railvan.com> wrote in message
news:66**************************@posting.google.c om...

You can't ignore nulls on the primary key, but any others are
perfectly acceptable. Hopefully this works for your project.


Yes, assuming that's what he wants. Robbie actually hasn't told us enough really.


You mean like why a two column primary key is necessary, yet not
necessary, at the same time?


Yes, something like that.
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
1
by: Joel | last post by:
Hi, How do you determine if a Date field is blank. In my Sql statement I only want records who's date field is blank (i.e. checking for only open invoices where Date_Paid = '' ...still open...
19
by: Joe Scully | last post by:
Hi all, I am having trouble with access adding a blank record to a subform everytime I finish entering data and closing the form. (The form and subform are based on the one table) When...
2
by: JC Mugs | last post by:
I have a form that when you tab from field to field that the entry point is blank, but if you point and click in the field it brings up a 0 and data entry is started to the left of the zero. ...
5
by: ChadDiesel | last post by:
My basic question is why does my print report button on my subform print a blank report when my cursor is on a blank entry line? Here is a more detailed explanation of my problem. I have a...
2
by: JohnR | last post by:
When creating an msAccess db within the Access UI itself the fields that are text are NOT padded with blanks. For example, if I have a 10 char field and put in "HI" and then when I come back to...
0
by: visionstate | last post by:
Hi there, I have a form which has 2 text boxes, a combo box and a sub form in it (which reads from a query. The query reads from the table). On load, I would like the fields in the text boxes and...
1
by: BethanyBez | last post by:
Is there any way when doing a merge with an Access Query and a columned Word doc that I can avoid blank spaces where the field is blank? I am creating a columned contact sheet with the contacts...
4
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.