how to save a macro

T

TechyTemp

I was given the following macro to use to enter explanations in a memo data
type box: Me.MyMemoField.SelStart=Len(Me.MyMemoField.SelStart) I
entered it exactly as was given to me.

When I go to enter data into that box I get the following response:

'The macro (or its macro group) doesn't exist, or the macro is new but
hasn't been saved. Note that when you enter the macrogroupname.macroname
syntax in an argument, you must specify the name the macro's macro group was
last saved under.'

What do I need to do?
 
D

Douglas J. Steele

What you've got there is VBA code, not a macro.

I gather you're trying to type that expression into some event of your text
box. Rather than typing the expression there, select [Event Procedure] from
the pull-down list for the event property, then click on the ellipsis (...)
to the right of the box. The VB Editor should open up, with something like:

Private Sub TextboxName_EventName()

End Sub

Type your expression between those two lines.

(Note that depending on what expression you're using, there may be
parameters in the parentheses.)
 
T

TechyTemp

I did as you suggested and I did get a "compile error: method or data member
not found". The following was hilited ".MyMemoField" out of the expression
given me to enter.

I really don't know where to go from here. Help.

Douglas J. Steele said:
What you've got there is VBA code, not a macro.

I gather you're trying to type that expression into some event of your text
box. Rather than typing the expression there, select [Event Procedure] from
the pull-down list for the event property, then click on the ellipsis (...)
to the right of the box. The VB Editor should open up, with something like:

Private Sub TextboxName_EventName()

End Sub

Type your expression between those two lines.

(Note that depending on what expression you're using, there may be
parameters in the parentheses.)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


TechyTemp said:
I was given the following macro to use to enter explanations in a memo data
type box: Me.MyMemoField.SelStart=Len(Me.MyMemoField.SelStart) I
entered it exactly as was given to me.

When I go to enter data into that box I get the following response:

'The macro (or its macro group) doesn't exist, or the macro is new but
hasn't been saved. Note that when you enter the macrogroupname.macroname
syntax in an argument, you must specify the name the macro's macro group
was
last saved under.'

What do I need to do?
 
D

Douglas J. Steele

Do you have a text box named MyMemoField on your form? Odds are whoever gave
you that code expected you to substitute the actual name of your text box.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



TechyTemp said:
I did as you suggested and I did get a "compile error: method or data
member
not found". The following was hilited ".MyMemoField" out of the
expression
given me to enter.

I really don't know where to go from here. Help.

Douglas J. Steele said:
What you've got there is VBA code, not a macro.

I gather you're trying to type that expression into some event of your
text
box. Rather than typing the expression there, select [Event Procedure]
from
the pull-down list for the event property, then click on the ellipsis
(...)
to the right of the box. The VB Editor should open up, with something
like:

Private Sub TextboxName_EventName()

End Sub

Type your expression between those two lines.

(Note that depending on what expression you're using, there may be
parameters in the parentheses.)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


TechyTemp said:
I was given the following macro to use to enter explanations in a memo
data
type box: Me.MyMemoField.SelStart=Len(Me.MyMemoField.SelStart) I
entered it exactly as was given to me.

When I go to enter data into that box I get the following response:

'The macro (or its macro group) doesn't exist, or the macro is new but
hasn't been saved. Note that when you enter the
macrogroupname.macroname
syntax in an argument, you must specify the name the macro's macro
group
was
last saved under.'

What do I need to do?
 

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