Help with excel and access

Z

Zero_boy07

I need something that help me to keep some info display format like enters
and tabs, this is because when i import some info from excel this format
is changed, instead access represent the tabs and enters with characters,
and i need the format so i can define when a line starts and things like
that. I know this is the way that access do this but can anyone help me to
keep this format.
 
Z

Zero_boy07

Ok, i have this VB code:

Sub repLF()
For Each cl In Worksheets("apta").Cells.SpecialCells(xlCellTypeConstants,
23)
cl.Replace What:=(Chr(10) & Chr(13)), Replacement:=Chr(10),
SearchOrder:=xlByColumns
Next cl
End Sub

But i need to do this in access, but i dont know the exact syntax. Can
anyone help me?..
 
J

John Nurick

In Access, you do this sort of thing with an update query. Have the
query the field in question (let's call it XXX) to something like

Replace([XXX],Chr(10), Chr(13) & Chr(10))

This will sort out the linebreaks, but it will not help with tab
characters or any character formatting you may have in Excel. The
standard Access textbox does not recognise these.
 
Z

Zero_boy07

Does the field type MEMO support those? This is because im working with a
large aumount of text, so when i do the import the field is like MEMO.
 
J

John Nurick

Memo fields normally use the same textbox control as text fields, and
it's the control's capabilities that set the limits.

The usual way of displaying formatted text on Access forms is to store
rich text (RTF) in a memo field, and then to use a rich text control
instead of the ordinary textbox. There are lots of rich text controls
around, but not all of them work reliably on Access forms. Two that do
are Total Access Memo (www.fmsinc.com) and the one at
http://www.lebans.com/richtext.htm .

Even with these, handling rich text is not the simplest of tasks, and
searching for text with specific formats - which is what you seemed to
want to do in another message in this thread - can be quite a
programming challenge.
 
Z

Zero_boy07

Thanx, John.
I've already come with a solution to my little problem, a friend and i
developed a small application to replace CHR(10) with (CHR(13)&CHR(10)).
And with this i can maintain the format that i need.
 

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