This is driving me nuts. Works in one database but not in other...
Two forms... main form has a field called "prodno". I created a joined table (has ProdnoJoin and scanners) where it will be filtered on the main prodno and the user can add scanners as needed. What I want to happen is to automatically add the prodno to each new record in the joined table so user won't have to. It opens up filtered just fine, but a new record doesn't automatically have the prodno match fill in the prodnojoin field.
This is code I'm using..
Dim stDocName As String
Dim stLinkCriteria As String
Dim strPartNo As String
If Me.AllowAdditions = True Or Me.AllowEdits = True Then
stDocName = "frmScannerPartJoin"
strPartNo = Me.PartNo
stLinkCriteria = "[PartNoJoin]=" & "'" & Me![PartNo] & "'"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria, , , strPartNo
Else
MsgBox "Please click Edit Record button to update this record."
End If
Why oh why doesn't this work?????
Mary
Two forms... main form has a field called "prodno". I created a joined table (has ProdnoJoin and scanners) where it will be filtered on the main prodno and the user can add scanners as needed. What I want to happen is to automatically add the prodno to each new record in the joined table so user won't have to. It opens up filtered just fine, but a new record doesn't automatically have the prodno match fill in the prodnojoin field.
This is code I'm using..
Dim stDocName As String
Dim stLinkCriteria As String
Dim strPartNo As String
If Me.AllowAdditions = True Or Me.AllowEdits = True Then
stDocName = "frmScannerPartJoin"
strPartNo = Me.PartNo
stLinkCriteria = "[PartNoJoin]=" & "'" & Me![PartNo] & "'"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria, , , strPartNo
Else
MsgBox "Please click Edit Record button to update this record."
End If
Why oh why doesn't this work?????
Mary