dbTalk Databases Forums  

Help needed with simple field problem (0/1)

comp.databases.ms-access comp.databases.ms-access


Discuss Help needed with simple field problem (0/1) in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
lyle
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 04:09 PM






On Nov 23, 5:35 pm, rkc <r... (AT) rkcny (DOT) yabba.dabba.do.com> wrote:
Quote:
lyle wrote:
On Nov 23, 10:31 am, "Rick Brandt" <rickbran... (AT) hotmail (DOT) com> wrote:

?Form_Form1.AllowFilters
Run-time error '2467'
The expression you entered refers to an object that is closed or doesn't exist.

A quick check here:

Sub temp()
Debug.Print Form_Employees.AllowFilters
End Sub

True is printed in the Immediate Window.

Suppose you have two instances of a form open
and want to refer to the controls on a form contained
in a subform control on the form. If you use Form_FormName
which instance of the form is being referenced?
I don't know. Sometime when I consider it either worthwhile to have
two instances of a form open (with the form having a subform), or
likely that it will happen I'll check into it.
How is done using the [long idiotic string from hell] syntax?

I generally don't use subforms any more as the use of the syntax I
have suggested facilitates using full forms as sub forms ... with none
of the limitations of subforms.

When I use multiple instances of forms it is through code like:

Dim ADetailForms(0 To 1) As [Form_Faculty Details]
Public Sub OpenSomeFormInstances()
Dim z As Long
For z = 0 To 1
Set ADetailForms(z) = New [Form_Faculty Details]
With ADetailForms(z)
.Visible = True
.Caption = "Look Ma Multiple Distinguishable Instances of
a Form " & z
End With
Next z
End Sub

Public Sub ZapAllThoseFormInstances()
Erase ADetailForms
End Sub



Reply With Quote
  #42  
Old   
rkc
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 05:30 PM






lyle wrote:
Quote:
On Nov 23, 5:35 pm, rkc <r... (AT) rkcny (DOT) yabba.dabba.do.com> wrote:

Suppose you have two instances of a form open
and want to refer to the controls on a form contained
in a subform control on the form. If you use Form_FormName
which instance of the form is being referenced?

I don't know. Sometime when I consider it either worthwhile to have
two instances of a form open (with the form having a subform), or
likely that it will happen I'll check into it.
That'll be great.


Reply With Quote
  #43  
Old   
lyle
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 10:14 PM



On Nov 24, 7:46 pm, "David W. Fenton" <XXXuse... (AT) dfenton (DOT) com.invalid>
wrote:
Quote:
D... (AT) NoEmail (DOT) com wrote innews:td4dk3hbjljdf1pn052a34ar8b20rpvumi (AT) 4ax (DOT) com:

"Me" is a reference to the CLASS MODULE of the object the code is
in.
Private Sub Form_Load()
Debug.Print Me Is Me.Module 'False
Debug.Print TypeName(Me), TypeName(Me.Module) 'Form_Issue List, Module
Debug.Print VarPtr(Me), VarPtr(Me.Module) '1297044,1296972
Debug.Print ObjPtr(Me), ObjPtr(Me.Module) '1563856, 55509776
End Sub


Reply With Quote
  #44  
Old   
lyle
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 10:17 PM



On Nov 24, 7:46 pm, "David W. Fenton" <XXXuse... (AT) dfenton (DOT) com.invalid>
wrote:

Quote:
"Me" is a reference to the CLASS MODULE of the object the code is
in.
Private Sub Form_Load()
Debug.Print Me Is Me.Module 'False
Debug.Print TypeName(Me), TypeName(Me.Module) 'Form_Issue List, Module
Debug.Print VarPtr(Me), VarPtr(Me.Module) '1297044,1296972
Debug.Print ObjPtr(Me), ObjPtr(Me.Module) '1563856, 55509776
End Sub


Reply With Quote
  #45  
Old   
lyle
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 10:46 PM



On Nov 24, 7:51 pm, "David W. Fenton" <XXXuse... (AT) dfenton (DOT) com.invalid>
wrote:
Quote:
lyle <lyle.fairfi... (AT) gmail (DOT) com> wrote innews:48c3dde7-07bd-48b8-91c3-e157b703f92b (AT) f3g2000hsg (DOT) googlegroups.com
:

Sometime when I consider it either worthwhile to have
two instances of a form open (with the form having a subform), or
likely that it will happen I'll check into it.

Huh? What about a single form with two copies of the same subform?
TTBOMK VBA will search down the stack, so to speak, for the first
pointer to the subform; thus it will reference the last created
instance of the subform.



Reply With Quote
  #46  
Old   
lyle
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 11:08 PM



On Nov 24, 7:51 pm, "David W. Fenton" <XXXuse... (AT) dfenton (DOT) com.invalid>
wrote:

Quote:
I can't believe your applications have such poor UI that you don't
use subforms or that you're such a poor programmer that you'd not
re-use a form in more than one location if it were appropriate (as
it very often is).
I can't think of any case where I have used the same form twice as a
subform (on the same parent form) so I can't say how I would deal with
that, but I expect it would be smoothly and efficiently, if I used
subforms, that is, but, of course, I don't. I think I stopped using
subforms five years ago or so; as I roll my own, users do not seem to
notice, except that they like to be able to move and size the "sub"
form.
I'm not sure if you were a regular here in CDMA when I posted in more
than one thread about exposing forms in library mdbs, making them
available for reuse not only within one application, but within many
at the same time. That must be almost ten years ago.
I really hope you won't bother yourself with my level of programming
expertise. It's been of sufficient quality over the past twenty-five
years that I have not had to seek clients actively during that time.
No need for you to miss your beauty sleep worrying about that.

I don't really expect to convert anyone to my position on this matter,
David, and arguing is tedious. So I'm checking out of this thread now.


Reply With Quote
  #47  
Old   
rkc
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 11:37 PM



David W. Fenton wrote:
Quote:
Doug (AT) NoEmail (DOT) com wrote in
news:td4dk3hbjljdf1pn052a34ar8b20rpvumi (AT) 4ax (DOT) com:

I wish one of them had a short section on globally accessing
things that don't happen to to pointed to my "Me."

"Me" is a reference to the CLASS MODULE of the object the code is
in. If you want to refer to a different object, you have to specify
it completely. Another form will be Form!frmOtherForm in place of
Me. A form that is embedded in the form you're coding in will be
Me!subFormControlName.Form.

That's all you need to know.

I would say Me is a way to reference an instance of an object
from within the class module that defines the object. It's all
a bit fuzzy in Access since so much of the implementation of the
objects defined by the application is hidden.




Reply With Quote
  #48  
Old   
rkc
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-24-2007 , 11:48 PM



lyle wrote:

Quote:
I don't really expect to convert anyone to my position on this matter,
David, and arguing is tedious. So I'm checking out of this thread now.
You're efforts are not wasted, Sir Lyle of Fairfield.
I learned of this from you previously, have investigated it
further, and am grateful to you for having enlightened me.

I just don't use it.

Take from that what you will.


Reply With Quote
  #49  
Old   
Neil
 
Posts: n/a

Default Re: Help needed with simple field problem (0/1) - 11-25-2007 , 02:17 PM




"lyle" <lyle.fairfield (AT) gmail (DOT) com> wrote

Quote:
When I use multiple instances of forms it is through code like:

Dim ADetailForms(0 To 1) As [Form_Faculty Details]
Public Sub OpenSomeFormInstances()
Dim z As Long
For z = 0 To 1
Set ADetailForms(z) = New [Form_Faculty Details]
With ADetailForms(z)
.Visible = True
.Caption = "Look Ma Multiple Distinguishable Instances of
a Form " & z
End With
Next z
End Sub

Public Sub ZapAllThoseFormInstances()
Erase ADetailForms
End Sub

Hi, Lyle. I responded to this in a new thread I started here called "Working
With Multiple Form Instances." If you could take a look at it, I'd
appreciate it. Thanks!

Neil




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.