syntax

A

awsmitty

I hope this helps. I have a form called frmControlSchedule.
frmControlSchedule has several tabs; one of them is labled Search_for_Grid.
The tab, Search_for_Grid has a subform called frmsubAllRouteData.
frmsubAllRouteData is a datasheet. I am trying to address anyone of several
fields within frmsubAllRouteData, one of which is B_BLK.

I have tried all types of variations on the following:

If Search_for_Grid.[frmsubAllRouteData].Form![B_BLK] < 99999 Then

I have moved the brackets around, with and without brackets, various
variations with ! and . I have swapped places with Search_for_Grid,
frmsubAllRouteData, and have included frmControlSchedule. I can’t get
anything to work. I assume that frmControlSchedule would be default and
could be left out regardless of the full syntax.

Again, hope this helps
 
J

John W. Vinson

I hope this helps. I have a form called frmControlSchedule.
frmControlSchedule has several tabs; one of them is labled Search_for_Grid.
The tab, Search_for_Grid has a subform called frmsubAllRouteData.
frmsubAllRouteData is a datasheet. I am trying to address anyone of several
fields within frmsubAllRouteData, one of which is B_BLK.

I have tried all types of variations on the following:

If Search_for_Grid.[frmsubAllRouteData].Form![B_BLK] < 99999 Then

I have moved the brackets around, with and without brackets, various
variations with ! and . I have swapped places with Search_for_Grid,
frmsubAllRouteData, and have included frmControlSchedule. I can’t get
anything to work. I assume that frmControlSchedule would be default and
could be left out regardless of the full syntax.

Again, hope this helps

The Tab Control doesn't come into the control referencing syntax at all. It's
just a *visual* way of arranging controls on the screen, in effect. Controls
(including Subform Controls) are referenced in exactly the same way, whether
they're on a tab page or not.

Assuming that the Name property of the subform control on the tab page is
frmsubAllRouteData (note that the Subform Control, the container, may have a
name different than the name of the form object within that control), try

If Me!frmsubAllRouteData.Form![B_BLK] < 99999 Then

The Me! keyword just means "the form containing this code" -
frmControlSchedule in this instance. You can use either but Me! makes the code
easier to move from form to form.
 
A

awsmitty

John,

Come to find out it was the name property. That explains my frustration,
but I really thought I had checked that. I read about it in one of the books
from the library, plus I believe I also read about it right here in one of
these posts.

Which brings me to another question. Let's say there is B_BLK on one tab,
as a control, and B_BLK on another tab. Seems to me they are in fact one and
the same. Change one, the other changes right along with it. Is that the
case?


Thanks

--
awsmitty


John W. Vinson said:
I hope this helps. I have a form called frmControlSchedule.
frmControlSchedule has several tabs; one of them is labled Search_for_Grid.
The tab, Search_for_Grid has a subform called frmsubAllRouteData.
frmsubAllRouteData is a datasheet. I am trying to address anyone of several
fields within frmsubAllRouteData, one of which is B_BLK.

I have tried all types of variations on the following:

If Search_for_Grid.[frmsubAllRouteData].Form![B_BLK] < 99999 Then

I have moved the brackets around, with and without brackets, various
variations with ! and . I have swapped places with Search_for_Grid,
frmsubAllRouteData, and have included frmControlSchedule. I can’t get
anything to work. I assume that frmControlSchedule would be default and
could be left out regardless of the full syntax.

Again, hope this helps

The Tab Control doesn't come into the control referencing syntax at all. It's
just a *visual* way of arranging controls on the screen, in effect. Controls
(including Subform Controls) are referenced in exactly the same way, whether
they're on a tab page or not.

Assuming that the Name property of the subform control on the tab page is
frmsubAllRouteData (note that the Subform Control, the container, may have a
name different than the name of the form object within that control), try

If Me!frmsubAllRouteData.Form![B_BLK] < 99999 Then

The Me! keyword just means "the form containing this code" -
frmControlSchedule in this instance. You can use either but Me! makes the code
easier to move from form to form.
 
J

John W. Vinson

Which brings me to another question. Let's say there is B_BLK on one tab,
as a control, and B_BLK on another tab. Seems to me they are in fact one and
the same. Change one, the other changes right along with it. Is that the
case?

If B_BLK is the Control Source then yes: it's the same data.

Remember - the data IS IN THE TABLE. It's not in the form! The form is *just a
window*, a way to look at the data. You could have twenty controls on the
form, all with the same Control Source (bound to the same field); they'd all
change when any of them changed, because you're changing the data where the
data is, in the Table.

If you tried to create two textboxes on the same form (neither on a subform)
both named B_BLK you would get an error because the names of all controls on
the form must be distinct.

As I said before, a Tab Control is *NOTHING* other than a way to manage screen
real estate, letting you visually organize the controls. It has no effect on
the logical or table-based relationships between the data.
 

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