Adding rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a form with a memo box that will be used to type in numerous rows of information. The problem is that I cant figure out how to add rows to the memo box. The cursor tabs to the box but it only has one row. Any help is appreciated
 
I THINK you mean you want to add rows??? Then in Form
Design... bring up the Properties Window of the field that
is set to memo and change Enter Key Behavior to New Line
In Field.

If I was wrong, pardon the intrusion...

-----Original Message-----
I created a form with a memo box that will be used to
type in numerous rows of information. The problem is that
I cant figure out how to add rows to the memo box. The
cursor tabs to the box but it only has one row. Any help
is appreciated
 
I created a form with a memo box that will be used to type in numerous rows of information. The problem is that I cant figure out how to add rows to the memo box. The cursor tabs to the box but it only has one row. Any help is appreciated

You can set the "Enter Key Behavior" property of the textbox to "New
line" in order to type multiple lines (or you can type Ctrl-Enter to
enter a newline character).

If these numerous rows of information have their own independent
existance, you may want to reconsider. Putting the data into a Memo
field is inefficient, makes the database prone to corruption, and
makes it harder to search for specific values. Might this not be
better as a one to many relationship to another table, in which each
"row" of information is a new record? These could be stored in Text
fields (if each row is less than 255 characters) and displayed on a
Subform.
 
Thanks for the response. I need more than 255 characters so I need to go with a memo box but cant find where to have ia automaticially go to the next line when the enter key is pressed. Any clues?
 
John's (and Gina's) answer is all you need. Just make sure that the Enter
Key Behavior property of your memo field is set to new line and your cursor
should go to a new line whenever you press enter. Or you can press
Ctrl-Enter, as John pointed out. You don't need any macros or anything.

DDM
"DDM's Microsoft Office Tips and Tricks"
http://ddmara.tripod.com

Impact said:
Thanks for the response. I need more than 255 characters so I need to go
with a memo box but cant find where to have ia automaticially go to the next
line when the enter key is pressed. Any clues?
 
Thanks for the response. I need more than 255 characters so I need to go with a memo box but cant find where to have ia automaticially go to the next line when the enter key is pressed. Any clues?

Yes: the one I posted in the message to which you replied.

You can set the "Enter Key Behavior" property of the textbox to "New
line" in order to type multiple lines (or you can type Ctrl-Enter to
enter a newline character).


Open your Form in design view. On the View menu select "Properties".
Select the textbox in which you are entering this memo field. Select
the All tab; scroll down until you find the "Enter Key Behavior"
property.

One of the choices that you are offered for this property is "New Line
in Field". Select it.

Now when you press the <Enter> key while typing in the textbox, you
will get a new line in the memo.

I'm sorry if my previous message was unclear!
 
On Fri, 26 Mar 2004 16:48:50 -0700, in
<[email protected]>, John Vinson

[...]
Putting the data into a Memo
field is inefficient, makes the database prone to corruption, and
makes it harder to search for specific values. Might this not be
better as a one to many relationship to another table, in which each
"row" of information is a new record? These could be stored in Text
fields (if each row is less than 255 characters) and displayed on a
Subform.

I've recently built an application (well, it's still a work in
progress, actually), using Access 2000, that the user is employing for
(inter alia) the creation of time and materials Invoices (and
occasional Estimates).

An essential component - indeed requirement - for the user (an
independent electrical contractor whose volume is probably about 25 to
30 invoices per month) is that he have the flexibility to incorporate
somewhat lengthy descriptive WorkDetails on each Invoice or Estimate.
(The Estimates actually have two memo fields: one for lengthy details
and a summary, the latter of which also gets produced in the Invoice).

After reading John's post, I did a spot check of the details in the
50+ invoices he's generated to date, and as far as I can tell, none is
less than 255 characters (including spaces) - some are over 700. And
that's the good from what the user has told me, it is
conceivable that on occasion this may run to more than one page of
text (in 8pt Arial).

I was not aware of this alarming (but undocumented?!) feature of memo
fields when I began this project. If only I knew then what I know now
:(( I'm not sure what I would have done, but I digress ...

The details are extensive and comprised of complete sentences. While
there is some repetition of phrases (for which he's using the
time-saving text substitution feature of ActiveWords, an app that is
far superior to MS Autotext feature, IMHO) each invoice is different.

Using additional text fields does not seem like a viable solution -
since I don't imagine that the user would be thrilled about having to
count characters as he formulates the text of his details section. The
details do need to be stored for historical purposes, but do not need
to be searchable. This being the case, are there any alternatives
and/or preventive measures one can implement - beyond using compact
and repair before exiting on each use - to reduce the possibility of
corruption?

One thing that occurs to me is to move the memo fields out of the
tables in which they currently reside and into their own separate
tables, (the lengthy EstimateWorkDetails currently has its own table)
but I've no idea whether or not this will help.

Alternatively, would it be feasible to call Notepad or Word for
entering these details and automate the saving, linking etc? If so,
could you point me in the direction of coding I would need to
accomplish this elegantly and seamlessly both from a data entry
perspective and from the perspective of incorporating the .txt or .doc
file into the actual invoice report?

Or does the low volume make this a non-issue? (She says wistfully!) If
so, at what point would it be likely to become an issue? FWIW, the
..mdb is currently at 5.23 MB

In short, is this application doomed (it's working so well for him,
productivity-wise as well as data-entry-and-mining-wise!) to
inevitable corruption or can it be saved?!

I posted here at the beginning of Feb. when I began this project, and
have lurked back from time to time. Many thanks, again, to John for
pointing me in the right direction initially - and to John and others
for the invaluable lessons I've learned from their posts in the
interim. And optimistically thanks in advance for any suggested
solutions to this particular problem.


hro
 
Alternatively, would it be feasible to call Notepad or Word for
entering these details and automate the saving, linking etc? If so,
could you point me in the direction of coding I would need to
accomplish this elegantly and seamlessly both from a data entry
perspective and from the perspective of incorporating the .txt or .doc
file into the actual invoice report?

Or does the low volume make this a non-issue? (She says wistfully!) If
so, at what point would it be likely to become an issue? FWIW, the
.mdb is currently at 5.23 MB
It is an issue because that is what the user wants. If you go into code
builder, and then look at Tools->References. Scroll down the list and there
should be a reference for the Word object library.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnima02/html/ima0102.asp
will give you some idea of the coding you're after.
HTH
Marc
 
It is an issue because that is what the user wants.

Well, the user certainly doesn't want an application that is doomed to
inevitable corruption :)
If you go into code
builder, and then look at Tools->References. Scroll down the list and there
should be a reference for the Word object library.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnima02/html/ima0102.asp
will give you some idea of the coding you're after.

Thank you, Marc. But, having read this article, before I go down that
path (for various reasons, it's not the one that I'd prefer to take),
please let me do a little perception checking:

Are you advising me that continuing to use the Memo fields means that
corruption *is* inevitable *and* that the only option is to use what
is, in effect, a Merge to a Word form .dot as the basis for all
Invoices and Estimates? And further are you suggesting that it is not
feasible to use a .txt file created in Notepad as a substitute to
contain the data that would go into the Memo fields?

During the course of the earlier part of my learning curve, I do
recall seeing the ability to incorporate an .xls file into an Access
form and - if corruption via Memo fields is, in fact, inevitable and
unavoidable by other means - I was hoping that one might avert
disaster by applying similar principles to a .txt file.

I did get as far as using a cmd button to call Notepad, where the user
can enter the WorkDetails:

==
Private Sub WorkDetails_Click()
On Error GoTo Err_WorkDetails_Click

Call Shell("NOTEPAD.EXE", 1)

Exit_WorkDetails_Click:
Exit Sub

Err_WorkDetails_Click:
MsgBox Err.Description
Resume Exit_WorkDetails_Click

End Sub
==

Optimistically assuming that this is a reasonable corruption avoidance
strategy ...

1. How should I modify the above to facilitate:

[From a hiddent bound txtMyWorkDetails which I've populated with the
reference to C:\...\myApp\Invoices\Inv1234.txt via a concatenation in
the AfterUpdate event of txtInvoiceNo], automate the file save as, so
that when the user closes Notepad, it will use the path\filename from
txtMyWorkDetails (thereby reducing the need for user input - and
chance for user error) to save the .txt file?

2. How should I modify the above code for a second cmd button to open
Notepad with Inv1234.txt displayed (so that the user can easily view
or edit the contents)?

3. What code would I need to ensure that in rptMyInvoice, the contents
of subrptMyWorkDetails will be the text from Inv1234.txt?

Additionally, if this particular approach is in fact doable (and is
not prone to future corruption and/or other problems of which, in my
naiveté, I may be unaware) is there a faster way to convert the
contents of the WorkDetails Memo fields of the existing 50+ Invoices
than manually copying each into Notepad and saving? (I'm fairly
confident I can successfully handle the task of populating the new
txtMyWorkDetails with the correct path\filenames) Or would it take
longer to create and test the code necessary to accomplish this?!

Thanks, again.
hro
 
Thank you, Marc. But, having read this article, before I go down that
path (for various reasons, it's not the one that I'd prefer to take),
please let me do a little perception checking:

Are you advising me that continuing to use the Memo fields means that
corruption *is* inevitable *and* that the only option is to use what
is, in effect, a Merge to a Word form .dot as the basis for all
Invoices and Estimates? And further are you suggesting that it is not
feasible to use a .txt file created in Notepad as a substitute to
contain the data that would go into the Memo fields?
Hi,
Just in the interests of safe programming and not wanting to introduce more
risks than necessary, I avoid memo fields. It's not inevitable but your user
is probably not into technical stuff, so it would be better to avoid it.

I was not advocating Word over Notepad, just if you wanted word, then that's
the type of coding you'ld want.
During the course of the earlier part of my learning curve, I do
recall seeing the ability to incorporate an .xls file into an Access
form and - if corruption via Memo fields is, in fact, inevitable and
unavoidable by other means - I was hoping that one might avert
disaster by applying similar principles to a .txt file.

I did get as far as using a cmd button to call Notepad, where the user
can enter the WorkDetails:

IIRC (if I recall correctly) shelling out is more expensive than opening
within the application - it depends if notepad has an exposed object model.
If I get time later, I'll do some searches for code manipulating it.
3. What code would I need to ensure that in rptMyInvoice, the contents
of subrptMyWorkDetails will be the text from Inv1234.txt?

Additionally, if this particular approach is in fact doable (and is
Depends on the object model being exposed - not really the other reasons)
not prone to future corruption and/or other problems of which, in my
naiveté, I may be unaware) is there a faster way to convert the
contents of the WorkDetails Memo fields of the existing 50+ Invoices
than manually copying each into Notepad and saving? (I'm fairly
confident I can successfully handle the task of populating the new
txtMyWorkDetails with the correct path\filenames) Or would it take
longer to create and test the code necessary to accomplish this?!
It is probably faster to manually do this, unless you trade off that you
will need a similar utility routine in your toolbox.
Thanks, again.
hro
--
Marc
 
On Thu, 15 Apr 2004 10:03:24 +1000, in
<[email protected]>, "Marc"

[...]
Hi,
Just in the interests of safe programming and not wanting to introduce more
risks than necessary, I avoid memo fields. It's not inevitable but your user
is probably not into technical stuff, so it would be better to avoid it.

Agreed that the user is not into technical stuff, but if there are
preventive measures he can take - and they're not too complex - I'm
sure he will use them. I'm just trying to become more informed so
that I can weigh the risks, benefits and trade-offs. If corruption
can be avoided by keeping each Memo Field in its own table and
religiously regular compact and repair, to my way of thinking, this
would be a good solution. But, as I mentioned in my first post, I've
no idea whether either or both of these steps will make any difference
as far as significantly reducing the risk is concerned.
I was not advocating Word over Notepad, just if you wanted word, then that's
the type of coding you'ld want.

Thanks for clarifying that. But I'm uncertain as to how I would
modify that code because, unless I am misreading the info on the page
via the link you provided, what I would need it to do is in fact the
opposite of what that code will accomplish. If I have to go this
route, my goal would not be to push data to Word/Notepad (except the
filename), but to ultimately bring the content of each .txt or .doc
into Access for the report.

[...]
IIRC (if I recall correctly) shelling out is more expensive than opening
within the application - it depends if notepad has an exposed object model.

IIRC is not an unfamiliar acronym to me ... but how do you weigh the
"expense" in a situation like this?! I experimented with both, and
found that Notepad opened (and closed) much faster than Word. As for
an "exposed object model" well, that's completely new to me! However,
from my searching it would appear that Notepad does not have one, and
I take it that this does not augur well!
If I get time later, I'll do some searches for code manipulating it.

Thank you. I've tried to find some myself, but I keep drawing blanks.
If you don't have time, perhaps you could just give me some hints on
likely keywords and point me towards the most likely locations of such
code.

And I should really try this first, because if this isn't doable,
there's no point in doing the first part!
Depends on the object model being exposed - not really the other reasons)
It is probably faster to manually do this, unless you trade off that you
will need a similar utility routine in your toolbox.

That's OK, if this is the path I end up following to avoid corruption,
I'll do it manually!

Thanks again for your help.
hro
 
After reading John's post, I did a spot check of the details in the
50+ invoices he's generated to date, and as far as I can tell, none is
less than 255 characters (including spaces) - some are over 700. And
that's the good from what the user has told me, it is
conceivable that on occasion this may run to more than one page of
text (in 8pt Arial).

I was not aware of this alarming (but undocumented?!) feature of memo
fields when I began this project. If only I knew then what I know now
:(( I'm not sure what I would have done, but I digress ...

I think I may have been overly alarming. It sounded like this poster's
application was using Memo fields inappropriately (for multiple
single-line details); your application is using memo fields as they
are intended to be used. They're not *dreadful* - they almost always
work as advertised; the drawbacks are that you can't search them as
efficiently, you can't index them (though I understand that you can
index the first 255 bytes in Access2003); and they are a little bit
less stable than text fields.

I'd go ahead and use Memos in this app. Just make sure you have up to
date backups (as you should in any case).
 
[...]

I think I may have been overly alarming. It sounded like this poster's
application was using Memo fields inappropriately (for multiple
single-line details); your application is using memo fields as they
are intended to be used. They're not *dreadful* - they almost always
work as advertised; the drawbacks are that you can't search them as
efficiently, you can't index them (though I understand that you can
index the first 255 bytes in Access2003); and they are a little bit
less stable than text fields.

I'd go ahead and use Memos in this app. Just make sure you have up to
date backups (as you should in any case).

Whew! Thank you, John ... now I don't have to lose any more sleep
wondering how I'm going to master the art of (ad)dressing an "exposed
object model"!


hro
 
now I don't have to lose any more sleep
wondering how I'm going to master the art of (ad)dressing an "exposed
object model"!

LOL!!!

what's more - it's an exposed object model to which anyone can get
Access!
 
Back
Top