Results 1 to 9 of 9
  1. #1
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110

    Expression On Click you entered as the event property Error

    Click image for larger version. 
<br /><script async src=
    Name: Access Error Message.png  Views: 15  Size: 70.0 KB  ID: 46235" class="size_large" />


    I am receiving the above error message when I use Access Runtime with my database.

    The steps I have are that the Main Menu Loads, I Open the first data entry form, for which there is one unbound field, the user selects the value, and clicks continue.

    It then displays the following message.

    The On click is VBA DoCmdOpenForm with Open Args.
    The On Open event on the following page is purely open args.

    I have lots of these all around the database and I have a very similar format on another database we have been using for ages, in fact this is almost the same, but cant fathom what causes this even.

    It compiles fine. It runs fine on my computer, even when I spilt the database on the computer, but when I package it and open it on another computer it does this.

    The onclick code is:

    Code:
    Private Sub Commandbtn_Click()
    DoCmd.OpenForm "FrmReportingAccident", , , "[TypeofIncidentID]="& Me.[TypeofIncident].column(0),,,Me.TypeofIncident.Column(0)
    DoCmd.Close acForm, Me.Name
    End Sub
    So I am passing the Primary Key from the Unbound form in the Bound Column of my ComboBox, in field TypeofIncident, not the value, to the Foreign Key on the receiving form.

    Any ideas why this is not working, because it works everywhere else?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Too many arguments.
    erase all after the first . Column(0)

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    and if column(0) is the bound column, you don't need to specify it

  4. #4
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110
    So I have tried resolving this issue by taking your suggestions on board and trying them.

    I have even re-built the page from scratch with your suggestions in the VBC code, but still finding that this does not work.


    Its strange because It works find for me when it is not being run on runtime, but the only thing it can run on in the office is Runtime.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Do you have option explicit at the top of the module? And have you compiled the code?

    Also have you tried running on your machine in runtime mode?

  6. #6
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110
    I've done the first two and all is fine.

    I have not tried to run it locally in runtime.

    I'll give it a go, but I do expect the same results.

  7. #7
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110
    Runtime version on my computer runs fine.

    So its a local computer issue.

    One I am not sure how to remedy because other runtime databases on that computer run fine.

    Thanks for your help thus far.

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    final thoughts

    try using a .accde rather than .accdb

    And have you tried decompiling/recompiling?

    And to go back to your first post - what do you mean by 'package it'

  9. #9
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110
    In order to get the database to work, I have decided to re-design the form causing the issue. I removed the form complete from the database. Recreated the form from scratch changed and now have a fully functioning database.

    There must have been some sort of bug but I do not know what.

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

Similar Threads

  1. Replies: 7
    Last Post: 04-13-2021, 02:13 PM
  2. Replies: 5
    Last Post: 06-18-2020, 02:34 AM
  3. Replies: 5
    Last Post: 06-08-2020, 11:17 AM
  4. Replies: 13
    Last Post: 07-03-2018, 10:13 AM
  5. Replies: 7
    Last Post: 05-08-2014, 10:34 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