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 / Database Design / July 2008

Tip: Looking for answers? Try searching our database.

OnCurrent Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
amanda_jb - 29 Jul 2008 16:57 GMT
I have created a message box in the OnCurrent Event on the my main customer
page to obtain information the first time a customer calls.  Everything works
ok, but when everytime I do a filter or open the form initially, it runs the
event twice.  

I have run similar codes in the past in the OnCurrent Event and it did not
do this so I don't understand how I've changed the Database to do so.. Can
anyone give tell me how to make this stop, only run once when records change?


Thanks for your help!!!
Signature

Amanda

Steve - 29 Jul 2008 20:12 GMT
The OnCurrent Event will fire everytime your Customer form opens because the
form goes from no record to the first customer record. You apparently have
code in the form's Open event to go to some other record than the first
record. This causes the OnCurrent Event to fire a second time.

Steve

>I have created a message box in the OnCurrent Event on the my main customer
> page to obtain information the first time a customer calls.  Everything
[quoted text clipped - 9 lines]
>
> Thanks for your help!!!
amanda_jb - 29 Jul 2008 20:58 GMT
I thought you were exactly right when I read this, unfortunately when I
checked, the only other event (which just is to change the forecolor If) is
also in the current.  It also goes to the first record of the table.  

Is it possible there is something in the default setting of the form? As I
said I've written a code similar, this is just yes or no msg box, and it
still does it.???

Thanks for your reply regardless!!
Signature

Amanda

> The OnCurrent Event will fire everytime your Customer form opens because the
> form goes from no record to the first customer record. You apparently have
[quoted text clipped - 16 lines]
> >
> > Thanks for your help!!!
Steve - 29 Jul 2008 21:24 GMT
When your opens, is it on the first record?

Try this:
Go to your OnCurrent event code. After the first line (Private Sub OnCurrent
...), put this code:
Exit Sub

The OnCurrent event will fire but none of the code (Except Exit Sub) will be
executed. See if you still get two messages. If not then this tells you that
something in your OnCurrent code is causing the form to go to two different
records.

Steve

>I thought you were exactly right when I read this, unfortunately when I
> checked, the only other event (which just is to change the forecolor If)
[quoted text clipped - 33 lines]
>> >
>> > Thanks for your help!!!
 
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



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