+ Reply to Thread
Results 1 to 6 of 6

Linking two forms in Access without using a subform

  1. #1
    Registered User
    Join Date
    12-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Linking two forms in Access without using a subform

    I want to link a form to another form without making the form a subform. I have three forms; a "main" form, a "mainsub" form, and a "project" form. I am trying to create a button on the "mainsub" form that will open the "project" form to a specific record. The common field in both forms is "projectid". This is the form field name and not the underlying table field name. I wrote this code, but it didn't work.

    Please Login or Register  to view this content.

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

    Re: Linking two forms in Access without using a subform

    If ProjectID is a string value, then you will need to surround it in quotes

    Please Login or Register  to view this content.
    BTW: forms don't have fields in Access. They have controls. Fields are located in tables. For future reference to avoid confusion.
    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
    12-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Linking two forms in Access without using a subform

    Thanks for the response. When I use this code a box opens and says "enter parameter value". Does it make a difference that the control Name is different from the control source name? I did this because the control source name was "IT Project ID" and I thought the spaces might interfere with the code.

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

    Re: Linking two forms in Access without using a subform

    That should not be an issue. I often name the controls differently from the fields. Perhaps you should upload your db with sample data (sanitize for confidential material). Make sure to run a compact and repair before uploading.

    Alan

  5. #5
    Registered User
    Join Date
    12-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Linking two forms in Access without using a subform

    Alan,
    Thanks for looking at this. Attached is the database. If you open the main form you will see the buttons next to the records that the code.
    Tom
    Attached Files Attached Files

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

    Re: Linking two forms in Access without using a subform

    Ok. I think the issue is that you have a subform inside the main form. This means that you need to identify the control in the subform using the syntax shown here: http://support.microsoft.com/kb/209099

    Alan

+ 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