pass value from form to any form

basilyos

Registered User.
Local time
Today, 10:39
Joined
Jan 13, 2014
Messages
256
hello

if i want to pass value from textbox in a form to another textbox in a form i use
Forms!Form1Name.FirstTextbox = Me.FirstTextbox

this works fine

but if i want to pass value from textbox in a specific form to any other form to a specific textbox for example txtname

i have a form contain the customers name
when i'm in any dialog i press shift+F1 so the customers form will open and when i double click on the chosen customer i want to get the name in that specific textbox in the form opened
 
You can use the OpenForm's OpenArgs argument.
Code:
DoCmd.OpenForm "yourFormName", OpenArgs:=Me.yourControlName
The in the Current event you can use
Code:
Private Sub Form_Current()
    If Len(Me.OpenArgs & "") <> 0 Then
        Me.yourControlName = Me.OpenArgs
    End If
End Sub
 
ok sir i'll give it a try
 

Users who are viewing this thread

Back
Top Bottom