Results 1 to 10 of 10
  1. #1
    dunnmel4 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Location
    Wisconsin
    Posts
    14

    Message Box

    Ok, I am trying to prevent a payment being applied twice and I am trying to create a message box but I seem to be putting the code in wrong or something. Plz help

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,523
    Are you getting an error? Is the highlighted text a function on this form?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dunnmel4 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Location
    Wisconsin
    Posts
    14
    yea it just says it needs to debug. i think i need to relate it back to the payments table some how.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,523
    It should be giving an error message that at least hints at the problem. Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    dunnmel4 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Location
    Wisconsin
    Posts
    14
    Sure. I created a floating table that would have the paymentId and the payment amount and then post that there...so then it would recognize the payment being present. I hope that makes sense. =)

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,523
    Your error is coming from the function IsPaymentAlreadyApplied. The SQL statement is bad, should be:

    Code:
      Set resultSet = CurrentDb.OpenRecordset("SELECT 1 " & _
                                              "FROM FloatingTable " & _
                                              "WHERE FloatingTable.PagoID = " & CStr(paymentId) & ";")
    You didn't have a line continuation on the second line.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    dunnmel4 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Location
    Wisconsin
    Posts
    14
    yea I just figured that out lol . but now nothing is happening...if you keep clicking the payment keeps reaccuring and the message box isn't popping up

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,523
    FloatingTable is empty, and offhand I don't see any code that would add a record to it, so that function will always return false, and so you'll never see the message box. Unless I've missed something.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    dunnmel4 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Location
    Wisconsin
    Posts
    14
    Ah I see what I'm doing wrong. Just needed someone else to look at it. Thanks a bunch!!!!

  10. #10
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,523
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Message Box question
    By bullwinkle55423 in forum Programming
    Replies: 1
    Last Post: 08-12-2010, 09:01 AM
  2. Message box issues.
    By thart21 in forum Programming
    Replies: 2
    Last Post: 05-29-2010, 12:58 AM
  3. error message
    By ngeng4 in forum Forms
    Replies: 85
    Last Post: 03-25-2010, 06:47 AM
  4. the message #Name? in the text
    By grad2009 in forum Forms
    Replies: 7
    Last Post: 02-22-2010, 05:41 PM
  5. message box help
    By shaz10010 in forum Forms
    Replies: 1
    Last Post: 04-17-2009, 09:11 AM

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