Mimic Macro in word on Access

S

salty_gu_ru

Hello,
I’m just getting started in Access and I love it. I’m an Engineer Coast
Guard and we currently use MS Word to create an engineering status log. I
have created the same log in Access all is well but my crew has one gripe,
macro's. On the Word version of the log Macro's have been created to save
time with repetitive log entries. Is their any way of creating a command in
Access to insert snippets of text in a field at the cursor? If so How?

Tank You,
Salty
 
M

Mikal via AccessMonster.com

Hi, Salty
<snip>

Is their any way of creating a command in
Access to insert snippets of text in a field at the cursor? If so How?
Make a table with the text entries you want in the field. In the data entry
form bound to the table you are entering in, change the textbox bound to the
field you want to enter pre-defined data in to a combo box and bind the combo
box's record source to the field in the table you just created. make the
control source of the combo box the field you want to enter data in. If you
want to keep users from entering anything except the pre-defined text, set
the combo box's limit to list property to true.
That ought to do it.

HTH

Mike

--
Mike Pippins

"We have met the enemy and he is us." -- Pogo Possum

Message posted via AccessMonster.com
 
S

salty_gu_ru

Mikal said:
Hi, Salty
<snip>

Is their any way of creating a command in

Make a table with the text entries you want in the field. In the data entry
form bound to the table you are entering in, change the textbox bound to the
field you want to enter pre-defined data in to a combo box and bind the combo
box's record source to the field in the table you just created. make the
control source of the combo box the field you want to enter data in. If you
want to keep users from entering anything except the pre-defined text, set
the combo box's limit to list property to true.
That ought to do it.

HTH

Mike
Mike,
Thanks for the tip, But will this allow the users to insert pre defined
sentence's scattered here and their amongst user's own created text in a
single Memo field?
 
M

Mikal via AccessMonster.com

But will this allow the users to insert pre defined
sentence's scattered here and their amongst user's own created text in a
single Memo field?

Sorry, Salty. It won't do it and I doubt it can be done. I don't think you
will be able to compile statistics from data in a memo field or search for it
either. It sounds li like you might consider making individual fields
anyplace you to record pre-defined data and reserve the memo field for notes.

Mike

--
Mike Pippins

"We have met the enemy and he is us." -- Pogo Possum

Message posted via AccessMonster.com
 
T

tina

well, yes, you can probably do it with some code. and i'd probably use a
table to hold the "snippets of text", one snippet per record, with another
field to identify the snippet, as

tblTextSnips
snipID
snipIdentifier
snipText

table data will look like

tblTextSnips
snipID snipIdentifier snipText
1 Weather1 clear and sunny, visibility unlimited
2 Weather2 partly cloudy, hazy, visibility 2 miles
3 Water1 light chop, strong undertow along coast

obviously i've no idea what your text snippets will be, but hopefully that
gives you a clear idea of the setup. you can use buttons on the data entry
form to run code that selects a particular record from tblTextSnips, and add
the code to the memo field in the current record, and then place the cursor
at the end of the added snip so the user can continue typing. something
along the lines of

Me!MemoFieldName.SetFocus
Me!MemoFieldName = Me!MemoFieldName _
& " " & DLookup("snipText", "tblTextSnips", "snipID = 1")
Me!MemoFieldName.SelStart = Me!MemoFieldName.SelLength

hth
 
M

Mikal via AccessMonster.com

tina said:
well, yes, you can probably do it with some code. and i'd probably use a
table to hold the "snippets of text", one snippet per record, with another
field to identify the snippet, as
Tina, I am most truly and humbly amazed.

(but I'm still not crazy about Memo fields)

Mike

--
Mike Pippins

"We have met the enemy and he is us." -- Pogo Possum

Message posted via AccessMonster.com
 
T

tina

VBA is great, isn't it? ;)
memo fields have their uses, of course, but as you mentioned in your post, i
hope the op is using the memo field for commentary, and not for storing
atomic data that should be stored atomically - in separate fields.
 

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