
Originally Posted by
focosi
@rpeare : what do you mean by "drag" ? At the top of my head drag&drop is not supported in Access forms.. or maybe I disabled some function??? Anyway, this is not a solution to me. I want to pass the value and lock the control every time I create a new linked record, I don't want to copy it manually and leave the field prone to accidental changes made by users. I have succesfully implemented passing the argument from the primary to the secondary form with the following code :
on the primary form :
Private Sub Donatori_Click()
On Error GoTo Err_Donatori_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Dati donatori"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.ID
Exit_Donatori_Click:
Exit Sub
Err_Donatori_Click:
MsgBox err.Description
Resume Exit_Donatori_Click
End Sub
on the secondary form :
Private Sub Form_Load()
Dim strOpenArgs() As String
If Not IsNull(Me.OpenArgs) Then
strOpenArgs = Split(Me.OpenArgs, ";")
Me.ID = strOpenArgs(0)
End If
End Sub
What I need is to pass the argument when I create a new record (still linked to same ID in the primary form) on the secondary form.. Any idea ?
@desibabu90 : maybe I'm wrong, but your video didn't help me.....