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 / March 2008

Tip: Looking for answers? Try searching our database.

Dirty Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NeonSky - 20 Mar 2008 22:16 GMT
Hello Everyone, I am scratching my head over this one and am hoping you may
be able to assist. I have a form where when I page from one form to the next
I would like a text boxes value to appropriately updated. What is odd is that
when I go from one record to the next the record does not update, it keeps
the previously updated value from the previous record. The only time the text
boxes value appropriately updates is when a text character is entered into
other fields....hoping you may be able to help. Thank you! Below you will
find my code. Thanks again.

Private Sub Form_Dirty(Cancel As Integer)

Dim strComment As String

strComment = DLookup("[Comments]", "tblErrorComments", "ErrorID = forms!
frmDisputes!ErrorID") & " "
Me.Comments.Value = strComment

End Sub
Dirk Goldgar - 20 Mar 2008 22:24 GMT
> Hello Everyone, I am scratching my head over this one and am hoping you
> may
[quoted text clipped - 18 lines]
>
> End Sub

The Dirty event isn't really appropriate for this, from your description.
The Dirty event only fires when a record is modified, so merely paging from
record to record won't fire it.  I think you should probably be using the
Current event.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

NeonSky - 21 Mar 2008 15:49 GMT
Hello Dirk, Thank you for you response! Though when I change "Dirty" to
"Current", I receive the following error message "Procedure declaration does
not match description of event or procedure having the same name." Any
thoughts? Thanks!
>> Hello Everyone, I am scratching my head over this one and am hoping you
>> may
[quoted text clipped - 6 lines]
>record to record won't fire it.  I think you should probably be using the
>Current event.
Dirk Goldgar - 21 Mar 2008 19:24 GMT
> Hello Dirk, Thank you for you response! Though when I change "Dirty" to
> "Current", I receive the following error message "Procedure declaration
> does
> not match description of event or procedure having the same name." Any
> thoughts?

The event procedure for the Dirty event has a Cancel argument, while the
event procedure for the Current event does not (because the Current event
can't be cancelled).  Change the proc header that I presume you have now:

   Private Sub Form_Current(Cancel As Integer)

to this:

   Private Sub Form_Current()

That ought to fix it.

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.