×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Adding data to filtered dataform

Adding data to filtered dataform

Adding data to filtered dataform

(OP)
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
Replies continue below

Recommended for you

RE: Adding data to filtered dataform

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close