Open another form with doubleclick

Skip Bisconer

Who Me?
Local time
Today, 13:12
Joined
Jan 22, 2008
Messages
285
I have two forms both using the field Part as an ID. The analysis form has purchasing criteria and the other has all the background detail that the analysis form uses to populate it's fields. I want to be able to double click the Part in the analysis form and open a tabbed form with the detail. I cannot seem to get this code to work so I have obviously left something out because I get Access cannot find the field "|" refered to in your expression. Will someone please take a look and set me straight?

Code:
Private Sub Part_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmL1ItemDetail", acNormal, "[Part] =" & [frmL1InventoryAnalysis]![Part]
 
'I have also tried using  
Private Sub Part_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmL1ItemDetail", acNormal, [Part] =[frmL1InventoryAnalysis]![Part]
End Sub
 
End Sub
 
You code is assuming that [Part] is a numeric value.

If it is numeric try:


Code:
Private Sub Part_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmL1ItemDetail", acNormal, ,"[Part] =" & Me.[Part]
End Sub

or

Code:
Private Sub Part_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmL1ItemDetail", acNormal, ,"[Part] =" & forms![frmL1InventoryAnalysis].[Part]

End Sub
 
Last edited:
Thanks for your input Boyd and Paul I now have it working now with this.


Private Sub Part_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmL1ItemDetail", , , "Part = '" & Me.Part & "'"
End Sub

Thing I don't understand is that Access help should have showed me the differences between Numbers Dates and Text. I spent hours reading and couldn't find anything in there that showed me how to do what you all have. Very discouraging to a novice.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom