View Full Version : Access 97 Split address in single cell/column


Primus
06-23-2010, 07:28 AM
Hi,

I'm a complete newbie with regards to Access 97! I have been given the task to try and tidy up a database that is not setup as we would like. Currently when we add customer addresses it adds the 5 lines of the address into the "Address" column all in the same cell:

http://img692.imageshack.us/img692/175/tablee.jpg (http://img692.imageshack.us/i/tablee.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

As we have around 4,000 customer addresses I'm trying to work out how to get Access 97 to go though the "Address" column take the fist line and put it into a new column "Add1" take the second line and put that into "Add2" and so on.

http://img691.imageshack.us/img691/4519/tableadd.jpg (http://img691.imageshack.us/i/tableadd.jpg/)

Is this at all possible and if so where do I start?

Thanks in advanced.

Galaxiom
06-23-2010, 03:23 PM
Split the field on the line breaks in VBA using the Split function.
http://office.microsoft.com/en-gb/access-help/split-function-HA001228911.aspx?origin=HA010131676

Access has a constant for the Line break character: vbCrLf

BTW you don't need to use external sites to upload images. Just see the advanced version of the post editor.

boblarson
06-23-2010, 03:41 PM
BTW you don't need to use external sites to upload images. Just see the advanced version of the post editor.

Yeah, here's the instructions (located in the Access FAQs category):

http://www.access-programmers.co.uk/forums/showthread.php?t=194680