PDA

View Full Version : Prob. copying Excel cell contents to Access field names


Gates Is Antichrist
09-26-2002, 03:46 PM
Greetings software geniuses. In an Access table I have the design grid up, so I can change field names. In Excel, I have a column with the field names (which are nonnumeric).

If I highlight a cell, Ctrl-C, go to Access and hit Ctl-V and enter, Access rejects it.
If I F2 a cell, scrape the 6 letters, Ctrl-C, go to Access and hit Ctl-V and enter, Access accepts it.

It's as though there's a control character, like a line feed, in the copy buffer. Any ideas or suggestions? A VBA solution to get it in the copy buffer is okay; then i can just hit a hotkey in Excel to copy it, and move down to the next. (However, activecell.copy fell into the same trap.)

TIA. There are tons of fields, so any effort-saving counts here.

GadgetGeek
09-26-2002, 03:51 PM
If the field names are all in a row in excel (not column), save the spreadsheet, then in access, import a table, type .xls and find that sheet. Then check the box that has "first row contains field names". Just a thought.

PK
09-26-2002, 04:14 PM
I tried a copy/paste into the notepad (raw text).

When all I do is copy/paste, I get the info, plus a linefeed. If I go through the "F2 a cell, scrape the 6 letters, Ctrl-C", routine, I do not get the linefeed.

But,
I cannot replicate your problem. If I go the the "table" tab in Access and hit the "new" button and select "design view", I have no problem pasting directly from XL even without the F2 stuff.

We are in XL and Access 97. Are you in a different version?

P

Gates Is Antichrist
09-26-2002, 04:38 PM
PK, my bad for omitting: XL02 and Access2K.

My Notepad result duplicates yours. But in Access 2000 I can paste with control-V, but upon hitting enter get "the field name is invalid." Am I the only one to see this?

Thank you Geek, that's smart advice. It may be a long trip, but if I import the Access table to Excel, insert the headers, save, and re-import to Access, mission accomplished. Thanks - this is the way to go for < 64K records (which unfortunately doesn't apply to me here :shake: )

PK
09-26-2002, 09:43 PM
What happens if you {Ctl-V}{backspace}{enter}

Does it remove the linefeed, or the last letter of your column name?

P

Gates Is Antichrist
09-26-2002, 10:26 PM
What happens if you {Ctl-V}{backspace}{enter}
Does it remove the linefeed, or the last letter of your column name?
PIt doesn't help. I can even cut it inside the field name, paste back, and can't hit enter. But if I then escape, that same content will paste in fine.

Since no one else indicated a similar result, perhaps it's just me.