H
Helen Martin
I want to create a command button on my form that will change the
properties of a control...
I have a form that has 4 controls in kind of a table format...
I tab through the controls doing data entry...
sometimes I am only entering two of the fields...
sometimes I am entering all four...
I'd like my command button to change the tab stop property for two of
the fields to NO when I am entering only two fields..
I can create the button, and get the module started, but I'm not sure
how to refer to the property of the control..
my first control is called [lot number] the second is called
[lot description] but I do not know now to refer to the property of
each that is called Tab stop..
I looked up up Chaning control properties in VB Code in the help and it
seems to say I should be able to do it something like this.. however
every way I try it causes the same error..
here is my code
=============
Private Sub All_tabs_Click()
Forms![items purchased].[lot number].[tab stop] = True
Forms![items purchased]![lot description].[tab stop] = True
End Sub
or.. they recommend this as faster..
Private Sub All_tabs_Click()
Me.[lot number].[tab stop] = True
Me![lot description].[tab stop] = True
End Sub
--------
or the help seemed to say I could just have a button that toggled the
tabs with code that looked something like
Private Sub Toggle_tabs_Click()
With Me![lot number]
.[tab stop]= Not .[tab stop]
End With
With Me![lot description]
.[tab stop]= Not .[Tab stop]
End With
End Sub
=================
however, every way I do it I get Error 438 which says this what I've
quoted below, which is way over my head... I have no idea what a Friend
procedure is or a Late bound call..
==============
Error 438
Not all objects support all properties and methods. This error has the
following cause and solution:
· You specified a method or property that doesn't exist for this
Automation object.
See the object's documentation for more information on the object and
check the spellings of properties and methods.
· You specified a Friend procedure to be called late bound.
The name of a Friend procedure must be known at compile time. It can't
appear in a late-bound call.
For additional information, select the item in question and press F1.
I've done only a little programming before and suspect I have it either
completely wrong, or only a tiny bit wrong..
I'd appreciate any help!
Helen
properties of a control...
I have a form that has 4 controls in kind of a table format...
I tab through the controls doing data entry...
sometimes I am only entering two of the fields...
sometimes I am entering all four...
I'd like my command button to change the tab stop property for two of
the fields to NO when I am entering only two fields..
I can create the button, and get the module started, but I'm not sure
how to refer to the property of the control..
my first control is called [lot number] the second is called
[lot description] but I do not know now to refer to the property of
each that is called Tab stop..
I looked up up Chaning control properties in VB Code in the help and it
seems to say I should be able to do it something like this.. however
every way I try it causes the same error..
here is my code
=============
Private Sub All_tabs_Click()
Forms![items purchased].[lot number].[tab stop] = True
Forms![items purchased]![lot description].[tab stop] = True
End Sub
or.. they recommend this as faster..
Private Sub All_tabs_Click()
Me.[lot number].[tab stop] = True
Me![lot description].[tab stop] = True
End Sub
--------
or the help seemed to say I could just have a button that toggled the
tabs with code that looked something like
Private Sub Toggle_tabs_Click()
With Me![lot number]
.[tab stop]= Not .[tab stop]
End With
With Me![lot description]
.[tab stop]= Not .[Tab stop]
End With
End Sub
=================
however, every way I do it I get Error 438 which says this what I've
quoted below, which is way over my head... I have no idea what a Friend
procedure is or a Late bound call..
==============
Error 438
Not all objects support all properties and methods. This error has the
following cause and solution:
· You specified a method or property that doesn't exist for this
Automation object.
See the object's documentation for more information on the object and
check the spellings of properties and methods.
· You specified a Friend procedure to be called late bound.
The name of a Friend procedure must be known at compile time. It can't
appear in a late-bound call.
For additional information, select the item in question and press F1.
I've done only a little programming before and suspect I have it either
completely wrong, or only a tiny bit wrong..
I'd appreciate any help!
Helen