Results 1 to 8 of 8
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    Form Based upon a One to One Relationship table that always shows first record?

    Hi all,
    I have put a sample db for this together due to size issues and uploads which I have attached. I created a one to one relationship between the two tables and when I click on my button to open the form, it always goes to first record, not what I want at all. It should give me the record that is with the open form (PersonFrm) PersonID. I have tried everything under the sun that I can come up with in my small mind to solve this. Basically it is a button to open a form to display extended info from a person. Should be simple I would have guessed but not. If someone could take a look as the form should only have one record per person. I had to take some samples from my main db as its to big to upload here so has some code that doesn't belong but don't interfer with what I am trying to accomplish. Would appreciate it if one of you could take a look and let me know what it is I am doing wrong with this one to one relationship?
    Thanks


    Dave

    Some Data.zip

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Sounds like you want this:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Hi and thanks however I am getting an error ? Type Mismatch
    DoCmd.OpenForm "PersonExtInfoFrm", , , "PersonID = '" & Me.PersonID & "'"

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    PersonID is a numeric field, is it not? You want the first syntax, without the ' delimiters.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thanks, that worked but something is wrong? I get a blank form (No fileds) when I go to a record that doesn't have an existing record in it? Blanks out the entire form.

  6. #6
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thanks
    I figured out, had set to no additions somehow? Must have done by mistake
    Thanks again!
    Dave

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Happy to help Dave!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    thanks a lot, I love this site

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 01-15-2019, 06:37 AM
  2. Replies: 1
    Last Post: 03-01-2018, 01:36 PM
  3. Replies: 10
    Last Post: 01-26-2018, 05:49 PM
  4. Replies: 5
    Last Post: 09-02-2016, 03:18 PM
  5. Replies: 5
    Last Post: 10-15-2010, 01:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums