Sel Functions for Queries imbedded in Forms

  • Thread starter Thread starter GRayL
  • Start date Start date
G

GRayL

When I imbed Table1 in a subform in datasheet view I can
determine size and location of a selected area of the
table by using SelLeft,SelTop,SelHeight, and SelWidth. If
I then imbed a Query like "Select * from Table1;" in the
subform, I no longer haver access to the size and
location of the selected area.

I normally get these values by using
Screen.ActiveForm.sfmName1.form.selheight

This works for tables but not queries. Can anybody shed
some light on this matter.

Thanks,

Ray
 
Open the form in Design View.
Click once on the query's subform.
Then display properties (e.g. using the button on the toolbar).
This should show you the name of the subform control.
That's what you should be using where you have sfmName1.

HTH
- Turtle
 
Turtle: Read my post again. I have no problem with the
name of the subform, or displaying its properties. It is
very strange that when the source object is a table, one
as access to the four sel properties. When it is a query,
these properties disappear from the collection. My
question is how do I determine, in code, the height and
width of a selected area of a query imbedded in a
subform - ie, the source object is a query? When the
object is a table in datasheet view. the line of
code "Screen.ActiveForm.sfmName1.form.selheight" works
just fine. When the souce object is a query in datasheet
view, that same line of code fails. I have spent days
examining all the properties of all the controls of the
form to no avail. I get a runtime error "2455 you have
entered an expression that has an invalid reference to
the property SelHeight"
 
Back
Top