+ Reply to Thread
Results 1 to 5 of 5

Open a new form, create new record based on current form / record

  1. #1
    Forum Contributor
    Join Date
    05-05-2009
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010 and 365
    Posts
    113

    Open a new form, create new record based on current form / record

    I am new to access. Using 2010. Pretty good with excel. I think I understand database basics but I'm having problems with what should be simple.


    I'm creating a dabase to track fixtures. Right now I have two forms. One to input / edit fixture data and one to sign out the fixture.

    I want to have a button on the fixture input form "Signout fixture" that will open the fixture signout form, create a new record and set the fixture ID to the fixture that is selected in the fixture input form.

    I can open the form and select existing records based on the current form. I can open the form and select a new record. I can't open the form, select a new record and set the fixture ID. I've tried macros and code. And I tried to find options when adding a button.



    I currently have:

    Please Login or Register  to view this content.
    It doesn't work. It says it's misspelled or doesn't exist. I've tried various different syntax and haven't come up with anything that works.


    I would think that there must be a very easy solution to this.


    Any help will be appreciated.

    Thanks,

    Ken


    EDIT

    I also tried using a subform to display the signouts for the selected fixture which was pretty cool but I had the same problem when creating a new record. That was a while back though so I'm not exactly sure. I ended up starting some scratch going with a more simplified approach.
    Last edited by Cyclops; 01-24-2013 at 02:16 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Open a new form, create new record based on current form / record

    I think that your original concept of a sub form is a better solution. Look at this tutorial on building a subform. Post back with questions you may have with your particular situation after you have attempted this scenario.

    http://www.datapigtechnologies.com/f...subforms1.html
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-25-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Open a new form, create new record based on current form / record

    Assuming the first form is called "Configure Fixture";

    Try shortening the referal down to [Forms]![Configure Fixture]![Combo_FixtureID].

    Also you may want to create an on open event for the second form which grabs the field from the previous form to set into the new form. Try this code;

    Please Login or Register  to view this content.
    Text6 is the name you have assigned to the field in the second form. The "Me" tells access to refer to the current form. You should be able to change the names around to what you need.

  4. #4
    Forum Contributor
    Join Date
    05-05-2009
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010 and 365
    Posts
    113

    Re: Open a new form, create new record based on current form / record

    Thanks for the info. I will try some things out at report back.

    It may be a few days.

  5. #5
    Forum Contributor
    Join Date
    05-05-2009
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010 and 365
    Posts
    113

    Re: Open a new form, create new record based on current form / record

    I got things working.


    It appears that the issue was that I was using setproperty when I needed to use setvalue. Didn't know that setvalue existed as I had to click on the show all function icon.


    Once I switched to set value it worked like a charm.


    Had I supplied all of the information...


    I do appreciate the help and I'll probably be back with more questions in the future. I do want to go back to the sub form but I think I want to get something functional first.

    Thanks again



    Now I just need to figure out how to mark the thread solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1