Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Dirty expression help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 21 Apr 2005 20:27 GMT
Hello,

i'm having some problems with this code.  i'm trying to see if a subform is
dirty from another subform in the same form.

here is the code

If Forms!ProctorForm!ProctorSbfrm1.Form.Dirty = True Then
  msgbox"Yes"
   else
    msgbox"no"
End if

ProctorForm is the main form and proctorSbfrm1 is the subform I want to see
if it is dirty.  Proctorsbfrm2 is the subform i'm running the code from.

I get an error saying it cant find the subform.

Any help would be great

Thank you
David
Dirk Goldgar - 21 Apr 2005 20:40 GMT
> Hello,
>
[quoted text clipped - 19 lines]
> Thank you
> David

Your reference looks syntactically correct to me, though you could
shorten a bit to:

   If Me.Parent!ProctorSbfrm1.Form.Dirty = True Then

One place errors creep in, in these references, is using the name of the
form object itself (being used as a subform) instead of the name of the
subform control displaying that form.  You must use the name of the
subform control, which may or may not be the same as the name of the
form that is its Source Object.

Another place I've seen errors is when the reference is made too early
in the sequence of events of the main form.  My experiments so far
suggest that the subform's form object isn't hooked up to the subform
control until the main form's Open event has finished executing.
Meanwhile, various things you can do may delay the completion of the
Open event.  So where in your code are you making the reference?

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.