receiving error message using setvalue on macro

T

Third_2007

Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
K

Klatuu

Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
 
T

Third_2007

Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


Klatuu said:
Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
K

Klatuu

Sorry, one question I forgot to ask. Is the subform a single form or a
datasheet or continuous form?

If it is not a single form, then you may not get the desired results. On
datasheet and continuous forms, there is actually only one instance of a text
box that shows multiple times, so anything you do to one will affect them all.

Also, this doesn't work for subforms:

[forms]![my_form]![my_textbox].[enabled],-1

Access doesn't see subforms loaded as a form. a subform is actually a
property of a subform control. You might try this and see if it works:

[forms]![my_form]![MySubformControlName].[Form]![my_textbox].[enabled],-1

MySubformControlName is the name of the subform control on the main form,
not the name of the form being used as a subform.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


Klatuu said:
Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
T

Third_2007

Its a continuous form...

I'll try what you gave me....
I'll let you know if it works...Thanks a lot Dave...
--
A Good life is expensive, There is something Cheaper, but it's not life.....


Klatuu said:
Sorry, one question I forgot to ask. Is the subform a single form or a
datasheet or continuous form?

If it is not a single form, then you may not get the desired results. On
datasheet and continuous forms, there is actually only one instance of a text
box that shows multiple times, so anything you do to one will affect them all.

Also, this doesn't work for subforms:

[forms]![my_form]![my_textbox].[enabled],-1

Access doesn't see subforms loaded as a form. a subform is actually a
property of a subform control. You might try this and see if it works:

[forms]![my_form]![MySubformControlName].[Form]![my_textbox].[enabled],-1

MySubformControlName is the name of the subform control on the main form,
not the name of the form being used as a subform.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


Klatuu said:
Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


:

Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
K

Klatuu

Thanks, please let me know how it works out.
I don't use macros, so I am not an expert on them, so I don't know if a
macro will address a subform like that or not. It would be the way you do it
in VBA, however.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Its a continuous form...

I'll try what you gave me....
I'll let you know if it works...Thanks a lot Dave...
--
A Good life is expensive, There is something Cheaper, but it's not life.....


Klatuu said:
Sorry, one question I forgot to ask. Is the subform a single form or a
datasheet or continuous form?

If it is not a single form, then you may not get the desired results. On
datasheet and continuous forms, there is actually only one instance of a text
box that shows multiple times, so anything you do to one will affect them all.

Also, this doesn't work for subforms:

[forms]![my_form]![my_textbox].[enabled],-1

Access doesn't see subforms loaded as a form. a subform is actually a
property of a subform control. You might try this and see if it works:

[forms]![my_form]![MySubformControlName].[Form]![my_textbox].[enabled],-1

MySubformControlName is the name of the subform control on the main form,
not the name of the form being used as a subform.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


:

Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


:

Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
T

Third_2007

Dave can you tell me how to do it in VBA...I'm receiving "object doesnt
contain automation" error...I'll try to do it in VBA...

If you have any good online reference, can you give me one...thanks a lot....
--
A Good life is expensive, There is something Cheaper, but it's not life.....


Klatuu said:
Thanks, please let me know how it works out.
I don't use macros, so I am not an expert on them, so I don't know if a
macro will address a subform like that or not. It would be the way you do it
in VBA, however.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Its a continuous form...

I'll try what you gave me....
I'll let you know if it works...Thanks a lot Dave...
--
A Good life is expensive, There is something Cheaper, but it's not life.....


Klatuu said:
Sorry, one question I forgot to ask. Is the subform a single form or a
datasheet or continuous form?

If it is not a single form, then you may not get the desired results. On
datasheet and continuous forms, there is actually only one instance of a text
box that shows multiple times, so anything you do to one will affect them all.

Also, this doesn't work for subforms:

[forms]![my_form]![my_textbox].[enabled],-1

Access doesn't see subforms loaded as a form. a subform is actually a
property of a subform control. You might try this and see if it works:

[forms]![my_form]![MySubformControlName].[Form]![my_textbox].[enabled],-1

MySubformControlName is the name of the subform control on the main form,
not the name of the form being used as a subform.
--
Dave Hargis, Microsoft Access MVP


:

Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


:

Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


:

Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
T

Third_2007

Dave...Thanks a lot.....It's working already...Just forget a Minor
details...But if you know any good site on database development using access
or any online reference...can you give me one...thanks a lot Dave
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


Klatuu said:
Thanks, please let me know how it works out.
I don't use macros, so I am not an expert on them, so I don't know if a
macro will address a subform like that or not. It would be the way you do it
in VBA, however.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Its a continuous form...

I'll try what you gave me....
I'll let you know if it works...Thanks a lot Dave...
--
A Good life is expensive, There is something Cheaper, but it's not life.....


Klatuu said:
Sorry, one question I forgot to ask. Is the subform a single form or a
datasheet or continuous form?

If it is not a single form, then you may not get the desired results. On
datasheet and continuous forms, there is actually only one instance of a text
box that shows multiple times, so anything you do to one will affect them all.

Also, this doesn't work for subforms:

[forms]![my_form]![my_textbox].[enabled],-1

Access doesn't see subforms loaded as a form. a subform is actually a
property of a subform control. You might try this and see if it works:

[forms]![my_form]![MySubformControlName].[Form]![my_textbox].[enabled],-1

MySubformControlName is the name of the subform control on the main form,
not the name of the form being used as a subform.
--
Dave Hargis, Microsoft Access MVP


:

Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


:

Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


:

Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 
K

Klatuu

There are a lot of them, but this one is one of the best and very
comprehensive:

http://www.allenbrowne.com/
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Dave...Thanks a lot.....It's working already...Just forget a Minor
details...But if you know any good site on database development using access
or any online reference...can you give me one...thanks a lot Dave
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


Klatuu said:
Thanks, please let me know how it works out.
I don't use macros, so I am not an expert on them, so I don't know if a
macro will address a subform like that or not. It would be the way you do it
in VBA, however.
--
Dave Hargis, Microsoft Access MVP


Third_2007 said:
Its a continuous form...

I'll try what you gave me....
I'll let you know if it works...Thanks a lot Dave...
--
A Good life is expensive, There is something Cheaper, but it's not life.....


:

Sorry, one question I forgot to ask. Is the subform a single form or a
datasheet or continuous form?

If it is not a single form, then you may not get the desired results. On
datasheet and continuous forms, there is actually only one instance of a text
box that shows multiple times, so anything you do to one will affect them all.

Also, this doesn't work for subforms:

[forms]![my_form]![my_textbox].[enabled],-1

Access doesn't see subforms loaded as a form. a subform is actually a
property of a subform control. You might try this and see if it works:

[forms]![my_form]![MySubformControlName].[Form]![my_textbox].[enabled],-1

MySubformControlName is the name of the subform control on the main form,
not the name of the form being used as a subform.
--
Dave Hargis, Microsoft Access MVP


:

Both the button and text box are on the subform...

If you have other suggestion please do so...thanks Klatuu...
--
A Good life is expensive, There is something Cheaper, but it''''''''s not
life.....


:

Is the button on the main form or the sub form?
Is the text box on the main form or the subform?
I am not sure a macro will work for you, but if you can answer the questions
above, I can offer a suggestion.
--
Dave Hargis, Microsoft Access MVP


:

Im working on a simple program right now,What I was doing is that I disable a
text box until a button is pressed. This button runs a macro which actually
set the value on that text box into enable.When I open the form and test the
macro., I does what it intended to do.How ever, If I use that same form
containing the button with a macro as a subform, im receiving the folowing
error:

Macro name:
Enable_value

Condition:
True

Action Name:
SetValue

Arguments:
[forms]![my_form]![my_textbox].[enabled],-1

Please help.I wanted to use the set value...but it aint working once I used
it in a subform...
 

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