Results 1 to 3 of 3
  1. #1
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192

    Form Opening

    Dear Experts,
    I am creating a Database for Genealogy.

    I do have 3 Forms:
    1. PersonFrm in which Persons can be added & in the subform their children can be added.
    2. PersonsListFrm which shows all the Persons.
    3. Main Menu

    When the PERSONS button is clicked, the PersonFrm will open as blank (The Load Event is DoCmd.GoToRecord , , acNewRec)

    When a PersonID in in the PersonsListFrm is clicked, the PersonFrm should open with that particular Person's data. I tried this on the Click Event: DoCmd.OpenForm "PersonFrm", , , "[PersonID]=" & Me.PersonID
    However, the Form is opening as blank only. This may be due to the Load event of the PersonsFrm



    I need your help to solve this problem.

    Thanks
    Alex

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Few ways to do this but you have to remove that line of code from the Load event and instead put after DoCmd.OpenForm "PersonFrm" in the click event of the PERSONS button.
    Another way that could work is using OpenArgs when calling the PersonFrm and testing for that in the Open event of the PersonFrm (if NZ(Me.OpenArgs"")<>"" then FIndThatID Else GotoNewRecord).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I can't figure out what you're doing. There is a form with a subform? Some how I think not but then again...
    So maybe from your main menu, provide the option to open showing all vs open to add new (if we're talking about opening the personfrm different ways). If add new, do as you're doing. If not, don't GoToRecord,,acNewRec. The option could be a combo from which they choose if you think there might be other methods of opening in the future, or a frame with 2 option buttons. You might want to review how to add and deal with a frame and it's options.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 9
    Last Post: 04-21-2017, 11:23 AM
  2. Replies: 8
    Last Post: 03-20-2017, 07:22 PM
  3. Replies: 2
    Last Post: 11-22-2015, 07:24 PM
  4. Replies: 3
    Last Post: 03-11-2015, 08:05 PM
  5. Replies: 5
    Last Post: 01-24-2015, 12:59 AM

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