I
ifoundgoldbug
this is the proper way everyone says this should be done.
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim test As Double
stDocName = "work order"
stLinkCriteria = Me![work order #]
' note that Me![work order #] and [work order]![work order #] are
the same field on different
' tables
DoCmd.OpenForm stDocName, , , "[work order]![work order #] = " &
stLinkCriteria
End Sub
the above code genereates the error "the OpenForm action was cancelled"
which I am told means that something is tryped in wrong. But even when
i get past this error it brings up a BLANK form instead of the record
that I was looking for.
Now where it gets screwy. here is code that does almost exactly what I
want (bring up the proper record) but I have NO idea how it does by all
means it SHOULDN"T
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim test As Double
stDocName = "work order"
stLinkCriteria = Me![work order #]
DoCmd.OpenForm stDocName, , , "[work order #] = stLinkCriteria"
End Sub
the above code will give me a dialog box where I enter in the value of
stlinkcriteria and it retrieves and displays that record. after the
dialog box is close stlinkcriteria goes back to it former value.
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim test As Double
stDocName = "work order"
stLinkCriteria = Me![work order #]
' note that Me![work order #] and [work order]![work order #] are
the same field on different
' tables
DoCmd.OpenForm stDocName, , , "[work order]![work order #] = " &
stLinkCriteria
End Sub
the above code genereates the error "the OpenForm action was cancelled"
which I am told means that something is tryped in wrong. But even when
i get past this error it brings up a BLANK form instead of the record
that I was looking for.
Now where it gets screwy. here is code that does almost exactly what I
want (bring up the proper record) but I have NO idea how it does by all
means it SHOULDN"T
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim test As Double
stDocName = "work order"
stLinkCriteria = Me![work order #]
DoCmd.OpenForm stDocName, , , "[work order #] = stLinkCriteria"
End Sub
the above code will give me a dialog box where I enter in the value of
stlinkcriteria and it retrieves and displays that record. after the
dialog box is close stlinkcriteria goes back to it former value.