Pasting Data into a Field

IGinc

Board Regular
Joined
Jun 14, 2009
Messages
148
I am creating a database of Countries, and now need to create fields for the states/provinces, as this data is easily found in lists, what steps do I take to paste into the correct field, I receive an error 'The Text is too long to be edited' when a direct paste. Not familiar with access or vba a simple solution for a newbie or documented way is most appreciated, thanks.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Find the list on a website that you want to use, copy it into Excel so you can play around with the formats and data, then you can copy the data into an Access database without considering which table it needs to go into as it will create a table. That is one method.

Another is to do the same but rather than copy into Access you can use a macro in the Database to TransferSpreadsheet into a table if you have it already designed.

Another method again is to get the data into Excel and format save etc, then in your database you can import it and use the guide to determing the table, and field names etc to use.

Can I suggest you remove the word Beta from your signature block as 2010 has been launched and it has gone beyound a Beta version. Sorry to raise that with you.
 
Upvote 0
Good luck and post back if you have any problems.
 
Upvote 0
In Access, I have a table created and designed, as it has other fields, I have tried a copy and paste from excel by pasting into the first row of the field and get an error 'the text is too long to be edited' again. Though I hit ctrl V by accident while waiting for an answer, and it pasted into the field, however, it wasnt in the right field, and I'm not sure why it worked that time.

How would I do a macro of TransferSpreadsheet? That sounds as the perfect solution. Thanks in advance.
 
Upvote 0
OK what you need to do first in the design of your table make sure the text fields are set to the largest amount available which is 255 characters, if when you try the import and it fails again you might need to change them to a memo field which allows more than 255 characters.

Build your macro.

Open the Database on the Create Tab look to the Right and Select Macro.
In the Macro select to show all the Actions near the top as from 2007 they restricted the Initial list.

Then select the Actions and find TransferSpreadsheet this will then open up all the arguments below, so you would work you way down the list.

Import is there by defualt
Excel Workbook there by defualt
Table Name = Add your table name here
File Name = Complete path to the workbook, its name and file extension Place " quotes around this part"
Has Field names = Yes
Shouldn't have to worry about the range.

Save the macro and then run it to see if it imports correctly.
 
Upvote 0
Trevor Thanks for your continued help, I do not know how to build macros though. I have no knowledge of VBA.
 
Upvote 0
I have been unable to solve this issue. Using access 2003, as I need to to have an .mdb format
 
Upvote 0
If you are using Access 2003 then in the database window select Macros and New then follow my instructions.
 
Upvote 0

Forum statistics

Threads
1,203,728
Messages
6,057,012
Members
444,902
Latest member
ExerciseInFutility

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top