I think the solution to this one should be fairly straightforward....I had this problem once before, but I got around it by not using a button (I made the user double click the line item)....
Take a look.
http://www.angelfire.com/pw/access/subproblem.doc
Thanks.
jatfill
07-25-2001, 11:31 AM
could you post the code you are using on the OnClick event of the button? I really could only take a guess without it...
yep...sure:
Private Sub GetDocs_Click()
Dim stDocName, stdocname2 As String
Dim stLinkCriteria As String
'Me.MANUFACTURER_CODE.SetFocus
stDocName = "Manufacturer Docs Make Table"
stdocname2 = "SubForm Retrieve Manuf Docs - Change"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True
DoCmd.OpenForm stdocname2, , , stLinkCriteria
End Sub
It makes a table, upon which the subform is based, and then opens the subform.
jatfill
07-25-2001, 12:57 PM
immediately I see that you have stLinkCriteria as a specification, but you don't have a value defined...
you need to add the variable... something like
stLinkCriteria = "[primaryID]=" & Me![controlname]
replace "primaryID" with the linked primary key & control name with the field on your subform that contains the primary key on it