L'apprentis
Redcifer
- Local time
- Yesterday, 17:13
- Joined
- Jun 22, 2005
- Messages
- 177
Hello, I am trying to find a way to open a form with a subform on a specific record (for the form and the subform), I came up with the following but keep getting a mismatch mistake which means me think I am not doing it right.
What would be the apropriate way to achieve what I am trying to do?
What would be the apropriate way to achieve what I am trying to do?
Code:
Dim stDocName As String
'To Link to 1) Drawing File ID on main form
Dim stLinkCriteria As String
'To Link to 2) Drawing ID on subform
Dim StLinkCriteria2 As String
stDocName = "FrmDrawingDetail"
stLinkCriteria = "[DrawingFileID]=" & Me![DrawingFileID]
StLinkCriteria2 = "Forms!stDocName!SFrmDrawingDetail.Form!TxtDrawingID=" & Me![DrawingID]
DoCmd.OpenForm stDocName, , , stLinkCriteria And StLinkCriteria2