I have two forms (Main-Add/EditRecipes, Second form-F_RecipeAdd1) and I want to be able to open a form (second form) on the click event. The first form has multiple fields (text boxes) and when I open the second form on click event I want to copy values from the second . Then at the end I want to close the last form opened. In other words on click event open form copy values and close.
Private Sub Command64_Click()
On Error GoTo Err_Command323_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "F_RecipeAdd1"
stLinkCriteria = "[Recipe Name]=" & "'" & Me![Recipe Name] & "'"
stLinkCriteria = "[Recipe code]=" & "'" & Me![Recipe Code] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command323_Click:
Exit Sub
Err_Command323_Click:
MsgBox Err.Description
Resume Exit_Command323_Click
'16 a 15
With Forms("F_RecipeAdd1")
Me.Combo1231.Value = .Combo779
Me.Text1117 = .Ing1StepNumber
'etc etc
End With
End Sub
*It opens the form but it won't move the values.
Private Sub Command64_Click()
On Error GoTo Err_Command323_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "F_RecipeAdd1"
stLinkCriteria = "[Recipe Name]=" & "'" & Me![Recipe Name] & "'"
stLinkCriteria = "[Recipe code]=" & "'" & Me![Recipe Code] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command323_Click:
Exit Sub
Err_Command323_Click:
MsgBox Err.Description
Resume Exit_Command323_Click
'16 a 15
With Forms("F_RecipeAdd1")
Me.Combo1231.Value = .Combo779
Me.Text1117 = .Ing1StepNumber
'etc etc
End With
End Sub
*It opens the form but it won't move the values.