Hello everybody!
I'm new to this nice forum and first want to say hello to all and thank you for your efforts
My question is simple but I couldn't find the answer anywhere, so I hope some one knows it:
How is the use of
?
See https : // docs.microsoft.com/de-de/office/vba/api/access.docmd.setparameter
I quote MS Docs:
I could not find any details on how to use the parameters that are set with SetParameter method.
Do you have a simple example how to use the parameters with OpenForm?
Thanks
Otto
I'm new to this nice forum and first want to say hello to all and thank you for your efforts

My question is simple but I couldn't find the answer anywhere, so I hope some one knows it:
How is the use of
Code:
Docmd.SetParameter
See https : // docs.microsoft.com/de-de/office/vba/api/access.docmd.setparameter
I quote MS Docs:
Example:Use the SetParameter method to create a parameter for use by the BrowseTo, OpenForm, OpenQuery, OpenReport, or RunDataMacro methods.
Syntax expression.SetParameter (Name, Expression)
expression A variable that represents a DoCmd object.
Parameter Name: The name of the parameter. The name must match the name of the parameter expected by the BrowseTo, OpenForm, OpenQuery, OpenReport, or RunDataMacro method.
Expression: An expression that evaluates to a value to assign to the parameter.
Code:
Private Sub cmdAddComment_Click()
DoCmd.SetParameter "prmComment", Me.txtComment
DoCmd.SetParameter "prmRelatedID", Me.txtId
DoCmd.RunDataMacro "Comments.AddComment"
End Sub
Do you have a simple example how to use the parameters with OpenForm?
Thanks
Otto