Results 1 to 4 of 4
  1. #1
    dniezby is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2013
    Posts
    183

    Any other events cause errors in already working events


    Any thoughts on why if I add a different trigger event for the same object I get errors?

    I have a On Current event for a form and I wanted to do something On Dirty but it gives me an error....And NOT in my current code. It's pointing out stuff in earlier code that DOES work until I put in the new OnDirty code?

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Examples of code and events, please.

    Dale

  3. #3
    dniezby is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2013
    Posts
    183
    Well, it's wasn't really code specific. It was meant as a WTF...But I supposed I could put something up here as an example.

    Okay; this code works. It's in a textbox on my member's page that displays a running total on the member's detail page.
    Code:
    =DSum("player_points","plr_transactions","member=" & [ID_memtbl])
    Now, if I add anything like:
    Code:
    Private Sub Form_Dirty()
    
    record_modified = Now()
    End Sub
    When I run the form, the code above that WORKS, suddenly doesn't.

    I also have some more code that the form uses:

    Code:
    Private Sub Form_Current()
    'Check to see if someone erased the memberID and it's blank.
        If IsNull(Me!member_id) Then
        'Alert the user that the member ID has been deleted.
            MsgBox "The ID of this player is missing or has been deleted. We will assign a new one."
        ' Assign the member a new ID
         Me!member_id = DMax("member_ID", "members") + 1
    'If the memberID is new record then find the last ID entered and increment it.
       If Me!member_id = 0 Then Me!member_id = DMax("member_ID", "members") + 1
       End If
    End Sub
    This code ALSO works UNTIL I put in more code in a different Subroutine.
    Last edited by dniezby; 05-23-2013 at 05:11 PM.

  4. #4
    dniezby is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2013
    Posts
    183
    HA OMG I'm such an idiot sometimes. I figured out what was going on.

    I wanted to update show an example to someone about how to use an updating timestamp to show when a record was edited or modified last and forgot to put in:
    (cancel as Integer)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 11-22-2011, 05:23 PM
  2. events on RECORDS?
    By vt800c in forum Access
    Replies: 1
    Last Post: 05-27-2011, 09:15 AM
  3. Events are "Non-Events"
    By caddcop in forum Forms
    Replies: 4
    Last Post: 04-07-2011, 10:08 PM
  4. Different Events
    By jo15765 in forum Programming
    Replies: 2
    Last Post: 12-07-2010, 12:45 PM
  5. Events Confusion?
    By homerj56 in forum Programming
    Replies: 5
    Last Post: 10-27-2010, 01:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums