[AccessD] Re: Syntax question about control references

Arthur Fuller artful at rogers.com
Tue Sep 7 09:51:30 CDT 2004


I loaded the object browser and looked at what Access thinks of as the
control names. Here I find that the controls are named like this:

	Ctl9_30_2004

So all it takes is one line to set the focus to said control:

	Me.Ctl9_30_2004.SetFocus

However, this is still not quite the perfect solution that I'm looking
for. The form in question is a datasheet with one frozen column, so the
titles of the rows are visible at all times. The line above places the
focus exactly where I want it, but the unfrozen part of the form scrolls
only far enough to make said column visible. What I really want is
either of these two options:

A) make the first of the scrollable columns BoY(date), i.e. 1/1/2004; or
B) make the first of the scrollable columns EoM(date), i.e. 9/30/2004.

In either case, I could construct the name by executing the EoM() and/or
BoY() functions, then substitute "_" for "/", then stringify that. But
will that work? I would need to plug the result into the statement, like
so:

	Me.<ctlName>.SetFocus

And that only gets me halfway to my goal, which is to scroll the columns
to that particular column.

Suggestions greatly appreciated!
A.




More information about the AccessD mailing list