copying and paste a value with a click between two forms

irade92

Registered User.
Local time
Today, 13:05
Joined
Dec 26, 2010
Messages
229
Hi
I have a from with two columns. I like with a click of a mouse (double click) to transfer value from from one field to another field in another form. Is it possible?
 
say you want to xfer Column1 to Column2 in another Form.(those are the names of the textbox).
Code:
Private Sub Column1_DblClick(Cancel As Integer)
If syscmd(acSysCmdClearStatus,acform,"theOtherFormName") > 0 Then _
    [Forms]![theOtherFormName]!Column2 = Me.Column1
End Sub
 
Thanks..I will try a little later and let you know..
 

Attachments

  • 2020-05-04_08-02-14.jpg
    2020-05-04_08-02-14.jpg
    186.2 KB · Views: 114
what I said is like this:
Code:
If syscmd(acSysCmdClearStatus,acform,"theOtherFormName") > 0 Then _
[Forms]![theOtherFormName]!Column2 = Me.Column1

you replace theOtherFormName with the correct name of the other form.
 
the value I want to transfer has to go into the field in a subform of main form
 
modify the second line of code:

[Forms]![theOtherFormName]![theSubformName].[Form]!Column2 = Me.Column1
 
the value I want to transfer has to go into the field in a subform of main form
Sorry to bother you!!
I tried this but seems not to work..Am I making mistake somewhere

Code Tags Added by UG
Please use Code Tags when posting VBA Code

Please feel free to Remove this Comment
https://www.access-programmers.co.u...e-use-code-tags-when-posting-vba-code.240420/

Code:
Private Sub E_BROJ_DblClick(Cancel As Integer)
  
    If SysCmd(acSysCmdClearStatus, acForm, "[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]") > 0 Then
     
       [Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept] = E_BROJ
       [Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept].Requery
       [Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept].SetFocus
      
    End If
End Sub
 
Last edited by a moderator:
slightly, yes

Code:
Private Sub E_BROJ_DblClick(Cancel As Integer)

If SysCmd(acSysCmdClearStatus, acForm, "frmSMETKI_MAIN_3") > 0 Then

[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3].Form![br_recept] = Me![E_BROJ]
'[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept].Requery
'[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept].SetFocus

End If
End Sub
 
slightly, yes

Code:
Private Sub E_BROJ_DblClick(Cancel As Integer)

If SysCmd(acSysCmdClearStatus, acForm, "frmSMETKI_MAIN_3") > 0 Then

[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3].Form![br_recept] = Me![E_BROJ]
'[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept].Requery
'[Forms]![frmSMETKI_MAIN_3]![fsubSMETKI_MAIN_3]![br_recept].SetFocus

End If
End Sub
Thanks a lot
 
you're welcome.
 

Users who are viewing this thread

Back
Top Bottom