Results 1 to 5 of 5

On Double Click event ~ set value/ copy data of selected field into a diff form

  1. #1
    sinisterfrog is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    22

    On Double Click event ~ set value/ copy data of selected field into a diff form

    I have a form that pops up (in datasheet view) when a customer is added to an order that shows all previous Shipping locations for the specific CustomerID. I would like to be able to double click on the ShippingID and have that populate on the original form. I assume this is a "on double click" event, but I dont know the vba to select the item I just clicked on and then add it to form.field of my choosing.



    Thank you in advance for any helpful information.

    -Matt

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,482
    Why don't you use a combobox or listbox on main form? Code can restrict the combobox/listbox choices to records for the specific customer. This is called cascading combobox/listbox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sinisterfrog is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    22
    Unfortunately due to some other design elements A combobox/list box wont work. That said, I also want to be able to use this feature elsewhere (or at least I think I do).

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,482
    What design elements prevent combo/list box?

    Options:

    1. second form sets value of first form field: Forms!firstformname!fieldname = Me.textboxname

    2. declare a global variable or TempVar that can be referenced from anywhere to set and read
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    sinisterfrog is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    22
    Forms!form1!field = me.field worked perfectly.

    I assume the issue arises from how I've set up my tables. I've attached an image of the table relations. I didnt like how Aliases were working so I built a table instead. Click image for larger version. 

Name:	Capture.JPG 
Views:	6 
Size:	45.8 KB 
ID:	38772

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

Similar Threads

  1. Replies: 12
    Last Post: 03-22-2019, 09:42 AM
  2. Replies: 7
    Last Post: 03-11-2017, 11:00 AM
  3. Replies: 3
    Last Post: 03-19-2015, 02:11 PM
  4. Opening records via Double-Click event on a search form.
    By IncidentalProgrammer in forum Programming
    Replies: 4
    Last Post: 11-21-2014, 03:47 PM
  5. Replies: 3
    Last Post: 08-21-2014, 07:42 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
  •  
Tech Forums: Microsoft Office Forums