Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding data to filtered dataform

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
0
0
US
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 :)
 
Never mind... figured it out..

I put

=[Forms]![frmNewParts]![partno]

in the default value of the field in the join form and that seems to work.

Mary :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top