Access Access - Opening an related form

Joined
Nov 14, 2009
Messages
4
Reaction score
0
Hello Everyone,

I have a form that needs to open a related record. Here is how it breaks down.

My first form, frmSearch_Projects, contains a Project_ID. I need the second form, 'frmSearch_Project_Details to open only the record that contains the matching Project_ID.

The tables have an established relationship. The Project_ID is the primary key on frmSearch_Projects and the foreign key on from_Search_Project_Details.

Here is what I have tried but clearly i'm wrong. I'm still teaching myself this stuff.

Private Sub Open_Details_Form_Click()
DoCmd.OpenForm frmSearch_Project_Details, , , [Project_ID] = [Form]![Project_ID],acFormEdit
End Sub

Any help is very much appreciated.

MB
 
i think you misses double quotes; use the help (F1) option to check that in details

ken
 
I am developing Access database for store inventory control systems. I do not know how to decrement the stock [QtyInStock] every time the store sales an item from the list.

i need a details help on this one please.

ken
 
This is correct syntax from a program I wrote in Access 2007:

stDocName = "frmFreeFormQuote"

stLinkCriteria = "[Quote_key]=" & Me![txtQuote_key]
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
Back
Top