Results 1 to 7 of 7
  1. #1
    jker is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Aug 2023
    Posts
    36

    need help with FUNCTION

    1-i inserted button on my access form and created an ON_CLICK event procedure



    2- created the following VBA code


    Private Sub Command77_Click()
    MsgBox ("hellow")
    MsgBox "ppppp"
    End Sub

    3- The message Box does not appear when i press the button....

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    Code:
    Private Sub Command77_Click()
    
    End Sub
    You wrote that from scratch or created the event from the property sheet? If from scratch the code may not be connected to the event. Regardless, if you go to the property sheet, select the button in design view, is [Event Procedure] showing there for the click event? If not, choose that from the drop down then click on the ellipses (...)
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    jker is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Aug 2023
    Posts
    36
    i added the button to my form, then BUILD EVENT, then i typed the following code..

    Private Sub Command78_Click()
    MsgBox "its works"
    End Sub

    then FILE/SAVE
    Then opened form in FORM MODE

    But even this code isnt working

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,007
    Upload the db.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    Don't know if it's a version thing or what, but I don't see a "BUILD EVENT" option - so yeah, post the db. See "how to attach files" at the top of this page if you need it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Also make sure that either the db is in a trusted location or you've explicitly enabled code to run.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,007
    You could also start learning to debug your code, as you are going to need that sooner than later.

    https://www.youtube.com/watch?v=6UIypRy1iE8&t=48s
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 15
    Last Post: 10-17-2018, 09:26 PM
  2. Replies: 2
    Last Post: 02-26-2017, 11:31 AM
  3. Replies: 3
    Last Post: 03-04-2016, 10:36 AM
  4. Replies: 8
    Last Post: 11-04-2014, 10:44 PM
  5. Replies: 8
    Last Post: 01-31-2014, 01:45 PM

Tags for this Thread

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