gotoRecord problem

vntim

New member
Local time
Today, 20:43
Joined
Jan 12, 2011
Messages
2
Good afternoon,
I am having difficulties working the below:
I have a main form (Invoices) with subform (InvoiceDetails) and a separate searchform (ProdSearch)
I now would like to be able when double click the product found via the search form to be added as a new record on my subform.
Both the searchform and the subform have Productkey as primarykey.

Private Sub SearchResults_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "InvoiceDetails"

stLinkCriteria = "[]=" & Me![SearchResults]
DoCmd.gotorecord "Invoicedetails", , , , acNewRec

End Sub

So far nothing works unfortunately.
I have a seprate option with DoCmd.openform for my customers and that works fine.
Hope someone can help.
Thanks!
Vincent
 
Hi

What i would do, rather than do it that way. Is i would add the record using an append query, based on the details and PK's you have and then requery the sub form.
 
Hi,

Thanks, will give this a try tonight.

Vincent
 

Users who are viewing this thread

Back
Top Bottom