PDA

View Full Version : Pass specific Data From One Form to Another with a double click



Grega
07-03-2020, 02:17 PM
Hi,

I would like to write a VBA code that could with double-click copy value from selected field in a form to another form.

For example, in the PopUp form named “frmGLO” in column “Refer2” I would like that double-click would copy value ("AR2A") to another opened form EntryHead in the field “Refer1”

Please see the picture below.

How can i make that?


26903

OBP
07-04-2020, 02:38 AM
In the form frmGLO's field Refer2 Double-Click Event Procedure put in

Forms![AR2A]![Refer1] = me.refer2
Assuming both forms are open.

ps I haven't tested the syntax, it is from memory.

Grega
07-04-2020, 03:31 AM
Thanks for the response-

I want it to pull up the specific value in a line where I am double clicking on.

In this case, I click on row 3 and column "Refer2" where is the value A32A selected. And I would like that value to be passeed in Entryhead form into textbox Reref1?
Similarly, if I clicked the fourth line, column "Refer2", the value of R123 would be transferred...

Grega
07-04-2020, 02:02 PM
I have somehow managed this by that link: https://www.access-programmers.co.uk/forums/threads/can-i-send-values-back-from-a-popup-form.297062/


This is the final code. So on the far left row on pop-up form just double click and value is pasted to other form!


Private Sub Form_DblClick(Cancel As Integer)

Forms!EntryHead!Refer1 = Me.Refer2

End Sub