+ Reply to Thread
Results 1 to 8 of 8

How do I make one field auto-enter a value based on another field?

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    USA
    MS-Off Ver
    MS Office 2003 (Access, Excel, Powerpoint, and Word)
    Posts
    4

    How do I make one field auto-enter a value based on another field?

    I am trying to set up a simple table for my daughter's homework.
    I have fields such as due date, assignment, checkbox for when it's completed, and class.
    Depending on the class, I would a separate field to automatically fill in whether it is an A-day class or a B-day class.
    So, I'm thinking something like... If Class = m, s, or i then enter A and If Class = h, e, or a then enter B.
    I really don't think this should be terribly difficult, but I cannot seem to make it work no matter what.
    Any help is greatly appreciated!!!
    Thank you!!!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: How do I make one field auto-enter a value based on another field?

    Is this an access question (it's posted in the access section) or an excel question (you only have escel 2003 listed in your profile)?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    USA
    MS-Off Ver
    MS Office 2003 (Access, Excel, Powerpoint, and Word)
    Posts
    4

    Re: How do I make one field auto-enter a value based on another field?

    It is indeed an Access question. I apologize and I have updated my profile.

  4. #4
    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: How do I make one field auto-enter a value based on another field?

    With your form open in Design view, type directly into the control the following expression
    Please Login or Register  to view this content.
    Alternatively, you could open your form in design view, click on the properties, click on the data tab and type the expression in the control source line. The result is the same.

    Good Luck
    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

  5. #5
    Registered User
    Join Date
    01-07-2013
    Location
    USA
    MS-Off Ver
    MS Office 2003 (Access, Excel, Powerpoint, and Word)
    Posts
    4

    Re: How do I make one field auto-enter a value based on another field?

    Thank you very much!! That solved that problem.
    Now... Since I changed the control in my form, that particular field is not auto-populating my table any more.
    How do I keep the auto-fill the way it is and have it populate both my form and my table?
    Thanks!

  6. #6
    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: How do I make one field auto-enter a value based on another field?

    Why do you need to populate your table? If the information is needed, it can be read on the form. If it is needed for analysis, then it can be calculated in a query and then exported to Excel, used as a record source for a report, etc. It is a calculated field and should not be stored in your table. It would require you to rerun the calculation every time you updated the data in the table. Not a good idea. Calculations are best done in forms and queries and not stored. Don't confuse data tables with spreadsheets. They are not the same and should be treated differently.

    More on this subject from Allen Browne: http://allenbrowne.com/casu-14.html

    Alan

  7. #7
    Registered User
    Join Date
    01-07-2013
    Location
    USA
    MS-Off Ver
    MS Office 2003 (Access, Excel, Powerpoint, and Word)
    Posts
    4

    Re: How do I make one field auto-enter a value based on another field?

    I thought the table would be easier for my daughter to work with.
    These are my last two questions (I hope)...
    If I just use the Form, is there a way I can make an icon on my desktop that will directly open the Form??
    Regardless of where the Form is opened from, can I force it to open in Datasheet View?
    (I have seen DoCmd.OpenForm all over the internet but I have no idea where/how to place it.)
    Thanks again!!!

  8. #8
    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: How do I make one field auto-enter a value based on another field?

    The answer to your questions are both Yes.

    I assume that you are using Access 2003 as that is what your profile is suggesting. Click on Tools-->Startup. Place your form name in the appropriate location in this window. That will open the form when your Access file is opened. Open your form in Design view. Click on format. In the default view, select DataSheet. Create a short cut for the file and place it on your desktop. When it is clicked on the file will open with the form open in Datasheet view.
    Best of luck and post back with any questions you may have.

+ 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