Copy and Paste Issues

D

David

This will take a little bit of explaining but I'm sure there is a very simple
explanation so please bear with me:

As part of a business operation for a charity I am doing some volunteer work
for, we need to be able to copy data from an Access data sheet and paste it
into a web form.

This has been working well until recently. We found that not all the
records were being imported by the web form correctly and it appears this is
because when Access does the copying it copies each record a bit differently.
The problem seems to be with a mobile number field which contains numbers
but is a text data type in the table.

When I copy this field (by selecting in the Access data sheet) and using
Ctrl + C and then paste into Notepad, I get mixed results like this:

Mobile
" 0274 863 000"
" 0274 111099"
" 0274 12345"
" 41 79 2222272"
021 0345 888
021 3336441
021 02 980 777

So some of the mobile numbers get pasted with quotes around them and some
don't. And the thing is when I look at the data in my forms and in the
underlying table the mobile numbers look exactly the same i.e. there doesn't
appear to be any leading or trailing spaces or anything like that.

Another clue may be that when I open the underlying table and sort a->Z on
the mobile field, they sort in a nonsensical alpahnumeric order. And then if
I select the column copy and paste into Notepad, all the records with mobile
numbers with quotes around them are at the top (seen as first in the
ascending order) for some reason and then all the others without quotes
follow.

Note that there are definitely no quotes in the actual data in Access,
they're added when I copy and paste - to some of the values???!! Most
unusual.

Can anybody help?

The problem is the web form I'm pasting into can't handle the quotes.
 
J

Jerry Whittle

Create a query based on that table and in it put a field like so:

Mobiles: Trim([Mobile])

See if that field will copy and paste correctly.
 
D

David

Jerry, thanks for your reply, unfortunately no, that doesn't help.

I had thought of this previously and so one thing I did was run the trim
function over that field in the table as an update query to remove any
possible occurrences of leading or trailing spaces. So I'm sure there are
none now.

I did put the line into my query though and still no luck.

What I have found though is that it occurs when I copy and paste in a
certain way.

In my form (or even via opening the table directly as a datasheet), I am
actually selecting 2 columns, a name and mobile no. I then copy and then
paste into notepad or what have you.

And I get this:
Full Name Mobile
3362 - Ashford Teal 027 111 5668
3288 - Bob Rix 021 185 3333
3279 - Tracy Gilless " 021 123 427"
3107 - RayBrown 0274 982000
3021 - Bill Sneddon 021 222 6269
3020 - Susan Sneddon 021 333 672

Names and number changed for privacy. But see how one of the lines pastes
differently to the others? The Tracy Gilless record has quotes around the
mobile number field and there's some leading spaces added in there as well.

When I look at her mobile no. in the underlying table, it is no different to
any other. I have tried removing it, typing it back in and so on and that
doesn't help.

The way I copy the data is as follows: The 2 columns I am copying are next
to each other in a datasheet on a form. I click in the top left field and
then the bottom field of the second column (there are more columns to the
right in the data sheet but I don't want to copy that data) this makes a
selection, and I then can copy and paste. And then I get the error.

If I just select that one mobile number and drag along it to make a
selection and then copy and paste into say notepad, I get the correct number
i.e. 021 123 427 and nothing else as you'd expect.

More info: In my underlying table (which is called PersonalDetails) there
are around 3500 records and around 20 of them do this. And when I sort on
mobile number (A-Z) they are all at the top. It's almost like Access is
seeing these 'in a different format' or something. But of course they're all
the same underlying field and so the same data type which is text of length
50.

I have also tried compacting and repairing the database but this doesn't help.

Any ideas would be much appreciated.

David

Is this a bug in Access?

Jerry Whittle said:
Create a query based on that table and in it put a field like so:

Mobiles: Trim([Mobile])

See if that field will copy and paste correctly.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


David said:
This will take a little bit of explaining but I'm sure there is a very simple
explanation so please bear with me:

As part of a business operation for a charity I am doing some volunteer work
for, we need to be able to copy data from an Access data sheet and paste it
into a web form.

This has been working well until recently. We found that not all the
records were being imported by the web form correctly and it appears this is
because when Access does the copying it copies each record a bit differently.
The problem seems to be with a mobile number field which contains numbers
but is a text data type in the table.

When I copy this field (by selecting in the Access data sheet) and using
Ctrl + C and then paste into Notepad, I get mixed results like this:

Mobile
" 0274 863 000"
" 0274 111099"
" 0274 12345"
" 41 79 2222272"
021 0345 888
021 3336441
021 02 980 777

So some of the mobile numbers get pasted with quotes around them and some
don't. And the thing is when I look at the data in my forms and in the
underlying table the mobile numbers look exactly the same i.e. there doesn't
appear to be any leading or trailing spaces or anything like that.

Another clue may be that when I open the underlying table and sort a->Z on
the mobile field, they sort in a nonsensical alpahnumeric order. And then if
I select the column copy and paste into Notepad, all the records with mobile
numbers with quotes around them are at the top (seen as first in the
ascending order) for some reason and then all the others without quotes
follow.

Note that there are definitely no quotes in the actual data in Access,
they're added when I copy and paste - to some of the values???!! Most
unusual.

Can anybody help?

The problem is the web form I'm pasting into can't handle the quotes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top