+ Reply to Thread
Results 1 to 3 of 3

Using Column with Blanks for Primary Key (Access & Excel)

  1. #1
    Registered User
    Join Date
    12-13-2019
    Location
    Michigan, United States
    MS-Off Ver
    365
    Posts
    9

    Using Column with Blanks for Primary Key (Access & Excel)

    Long story shorter, I have an Excel sheet that I'm trying to incorporate into Access. The issue is, that my current Excels sheet contains blanks in the A column. That same A column would also be the primary key for the Access Table import, which it doesn't like/work. So, what's the best way of going about this? I thought of making a second Excel sheet, which references the first, except the referenced A column contains a formula which refers to the original sheet. I cannot remove blanks either in VBA or some other method because of these formulas.

    A good note is this Excel sheet is constantly updated, so I have code in VBA to systematically update the Table in Access with the new information from the Excel sheet, it's just Im not sure how to solve this trivial question without tampering/ruining the original excel sheet.
    Last edited by AliGW; 12-20-2019 at 05:04 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Strange Access/Excel question

    How can you have a primary key for a record that is blank? Perhaps you should just insert a column A and have it number 1 up to be your primary key. Primary keys need to be unique and blanks do not fall into that category.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Using Column with Blanks for Primary Key (Access & Excel)

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have dont it for you this time, but you'll be expected to do it yourself in future.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Strange Excel VBA -> Access behaviour
    By ExcelDominator in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2013, 04:40 PM
  2. strange access import error
    By jedat in forum Excel General
    Replies: 0
    Last Post: 04-04-2011, 08:07 AM
  3. Access to Excel Question
    By glickz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2009, 11:54 AM
  4. Strange excel question
    By mckay in forum Excel General
    Replies: 2
    Last Post: 12-09-2005, 04:15 PM
  5. Replies: 4
    Last Post: 09-13-2005, 09:05 PM
  6. Excel vs Access what art the question?
    By PhilMontUSDA in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-23-2005, 05:05 PM
  7. [SOLVED] Question regarding a strange condition in Excel spdsht...
    By Flop in forum Excel General
    Replies: 2
    Last Post: 01-14-2005, 03:06 PM
  8. [SOLVED] strange excel question
    By Christo in forum Excel General
    Replies: 3
    Last Post: 01-07-2005, 10:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1