I'm using Access 2000. In my database, I have some reference tables that are linked to my data tables. They all have a basic structure of 2 text fields, ID and Name. For instance, my tblLocations table has fields LocationID and LocationName. In my data tables, I store the ID, which is a smaller string, and can reference the longer name. Standard one-to-many design with referential integrity.
I tried to be clever by creating a dummy record where the ID field is a zero-length string ("" and the Name would be set to something such as "{None}". This is primarily because one of my data tables uses three of these fields as part of the primary key, so they cannot be Null. In this table, I have assets (which may appear more than once in the table), and the Employee, Department, and/or Location who is responsible for the asset.
The problem is that on one of my forms, where the user assigns responsibility for the asset, they can select the Employee, Department, and Location by either ID or Name. I use a text box for the ID, and a Combo Box for the Name. It works quite well, except when the ID = "". Instead of the combo box showing "{None}", it is empty.
Is there some rule against using zero-length strings as the primary key? Is there some reason Access doesn't like this? Is it because Access doesn't like me personally? Please offer whatever help you can. It will be greatly appreciated. Sorry for my long-winded post, and thank you for bearing with me.
I tried to be clever by creating a dummy record where the ID field is a zero-length string ("" and the Name would be set to something such as "{None}". This is primarily because one of my data tables uses three of these fields as part of the primary key, so they cannot be Null. In this table, I have assets (which may appear more than once in the table), and the Employee, Department, and/or Location who is responsible for the asset.
The problem is that on one of my forms, where the user assigns responsibility for the asset, they can select the Employee, Department, and Location by either ID or Name. I use a text box for the ID, and a Combo Box for the Name. It works quite well, except when the ID = "". Instead of the combo box showing "{None}", it is empty.
Is there some rule against using zero-length strings as the primary key? Is there some reason Access doesn't like this? Is it because Access doesn't like me personally? Please offer whatever help you can. It will be greatly appreciated. Sorry for my long-winded post, and thank you for bearing with me.