Results 1 to 7 of 7
  1. #1
    cesarone82 is offline Novice
    Windows 11 Access 2016
    Join Date
    Jun 2009
    Posts
    25

    Add record on doubleclick on another form


    Hi

    I have a subform (a correspondence table) with a button which opens a form containing a client list. I'd like a client to be added to the correspondence table by double clicking on the form.
    The form is tbl_projclienti, the button is the one on the right which opens a client list, I'd like the record to be added by double clicking on the specific client.
    Any help?

    The form where i have to add a record is just a correspondence table, where I ahve a list of codclients assigned for every
    Progetti.zipproject.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Don't post the same question twice, without advising people?

    Cross posted https://www.accessforums.net/showthread.php?t=89011
    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

  3. #3
    cesarone82 is offline Novice
    Windows 11 Access 2016
    Join Date
    Jun 2009
    Posts
    25
    Yes sorry, I was not sure which one.

    Quote Originally Posted by Welshgasman View Post
    Don't post the same question twice, without advising people?

    Cross posted https://www.accessforums.net/showthread.php?t=89011

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    The form where i have to add a record is just a correspondence table, where I ahve a list of codclients assigned for every Progetti.zipproject.
    That is not a subform but a main form?

    Where do you intend to get the project number from?
    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
    cesarone82 is offline Novice
    Windows 11 Access 2016
    Join Date
    Jun 2009
    Posts
    25
    If you open the mainform projects or progetti i don t remember, there should be a sub form named projclienti (a correspondence table which has a a list of codclients assigned to the specific opened project in the main form), where i placed a button which basically opens a client list.

    Double clicking a client in the client list I should add a record to the projclient table with pjnum equal to the pjnum of the active project in the main form and codclient of the client where i double clicked in the client list. Basically assigning a client to the project number.

    Quote Originally Posted by Welshgasman View Post
    That is not a subform but a main form?

    Where do you intend to get the project number from?

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Seems my last reply went walkabout?

    Either pass the project number in to the second form as openings, or set a temp variable with that valu.
    Then you will have all you need to build the Insert sql statement, concatenating the values.
    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

  7. #7
    cesarone82 is offline Novice
    Windows 11 Access 2016
    Join Date
    Jun 2009
    Posts
    25
    Ok thanks, managed to make it work, now upon opening the lists form with the button located in the main form subforms; if i double click a record, that is correctly added to the project, with the doubleclick event procedure.
    I attach the file in case someone has comments or wants to see.Progetti.zip

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

Similar Threads

  1. Replies: 5
    Last Post: 08-18-2018, 10:23 AM
  2. Replies: 7
    Last Post: 11-06-2017, 02:45 AM
  3. List Box DoubleClick
    By Alex Motilal in forum Programming
    Replies: 3
    Last Post: 02-12-2017, 01:28 AM
  4. Replies: 2
    Last Post: 04-05-2013, 03:42 PM
  5. Replies: 5
    Last Post: 03-03-2010, 12:03 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