Make a button work in a continuous (sub)form

wrek

Registered User.
Local time
Today, 18:32
Joined
Jun 14, 2001
Messages
88
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.
 
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.
 
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
 

Users who are viewing this thread

Back
Top Bottom