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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Best way to know if a control in a datasheet sbfrm is null

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Portwood - 12 Jan 2008 02:38 GMT
I have a record for each contractual document (let's leave it general,
please). Actions are generated against that document. When all actions have
been resolved, the "owner" of the contractual document indicates completion
of document processing by filling in a DateCompleted field.

My Documents table is linked 1:M to an Actions table and I have a
corresponding form/subform. I want the DateCompleted field in the main form
to be disabled while there are any open Actions in the subform. To check for
this, what I do now is run a DCount() against the Actions table. This works,
but it seems unnecessarily time consuming to run a domain aggregate function
when the records are right there on the subform. It is rare to have more
than five actions for any one document.

The subform is in datasheet view, so I can't put a calculated field. I tried
code like the following in the main form's Current() event:

With Me.Actions.form.recordset
  .findfirst "criteria indicating an open action"
  Me.DateCompleted.enabled = .no match
end with

Doesn't work, I forget specifically why now. Anyway, the DCount() works, but
I'm hoping someone might have a faster way to do this.
Allen Browne - 12 Jan 2008 02:55 GMT
The DCount() is probably better than looping through the records of the
subform. It works reliably, which may not be the case for the subform (e.g.
if filtered, or timing issues if it were not loaded yet.)

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a record for each contractual document (let's leave it general,
>please). Actions are generated against that document. When all actions have
[quoted text clipped - 19 lines]
> Doesn't work, I forget specifically why now. Anyway, the DCount() works,
> but I'm hoping someone might have a faster way to do this.
David Portwood - 12 Jan 2008 18:28 GMT
Thanks, Allen. This saves me time trying out things that won't work.

> The DCount() is probably better than looping through the records of the
> subform. It works reliably, which may not be the case for the subform
[quoted text clipped - 23 lines]
>> Doesn't work, I forget specifically why now. Anyway, the DCount() works,
>> but I'm hoping someone might have a faster way to do this.
 
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



©2009 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.