|
-
Jan 22nd, 2013, 06:53 AM
#1
Thread Starter
Don't Panic!
[RESOLVED] Excel Data into Access
Hi,
Not technically a VB/VBA question but maybe you can tell me what I'm doing wrong. Having a thick day atm...
I'm copying data from an Excel (2010) sheet and pasting into selected fields of an Access (2010) table.
Usually works well, but for some reason now its skipping text data pasted into text fields. The majority of the data looks like a number (reference) but some are text. The table field is text and 255 chars.
Now when I paste it completes all fields properly except the reference field, which if it is a number (looks like one excel has it as one) then it pastes. But if its a text (or you put the single quote before the number) then it doesn't paste in the data.
I've not had this before, so wondering whether its a 'feature' of Excel/Access 2010 or whether MS have messed something up in the copy paste bit.
Any ideas welcome!
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jan 22nd, 2013, 07:15 AM
#2
Thread Starter
Don't Panic!
Re: Excel Data into Access
Hi,
I've fixed it I think...
I had to change the first 8 lines data in the reference field to a text via the single quote. Seems that the paste must be classed as an import so Access (vaguely pointing a finger that-a-way) seems to guess the data type by the data, then pastes it in. Rather than checking the fields data type. This results in the original data being evaulated as a number, so any text is ignored.
What a pain.
Please add a post if you've come across this, or if you know of an MS fix... Or for that matter if you have a link to request this be looked at in the next installment of MS product updates...
Thanks in advance
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jan 22nd, 2013, 03:35 PM
#3
Re: Excel Data into Access
as you do not show the current code where the problem is occurring, it is hard to suggest a correction or work around
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jan 24th, 2013, 08:06 AM
#4
Thread Starter
Don't Panic!
Re: Excel Data into Access
Westconn -- no code... literally a cut n paste from Excel to Access.
This is the best place for finding out workarounds and helpful hints coding wise, but I didn't know of a general question place/forum... hence a question here and my second post above...
I'm taking it its only me then as no one else responded...
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jan 24th, 2013, 03:15 PM
#5
Re: Excel Data into Access
I'm taking it its only me then as no one else responded...
not so unusual currently
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|