Results 1 to 9 of 9
  1. #1
    toreberg is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    4

    creating combobox based in value in current row of continius form


    I have this access database

    tblProjects:
    .id
    .name

    TblProjectphases
    .id
    .name
    .project


    tblHours:
    .date
    .project
    .projectphase
    .hours

    the tblProjectphases is linked to tblProjects where the tblProjects.id = tblProjectphases.project


    I have made a continuous form, frmHours, auto generated from tblHours

    I want to use the form frmHours to add entries into tblHours
    When I select the projectphase control (combobox) I want to be able to pick a projectphase from the projectphasesthat have the same value in .project field as the value .projectphase in frmHours
    How can I do this?
    I would very much appreciate any help

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Welcome.
    Please tell us more about the proposed application. Do you have Employees who work on Project phases?
    Is this part of a Time/Wages reporting set up? What exactly is tblHours used for?

  3. #3
    toreberg is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    4
    Thanks!
    I am making an application to register hours worked on projects which run through phases. Each project has it's own phaces.
    When I click the combobox for projectphase I want only the phases defined for that project to show in the combo list

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    A project can be in more than one phase at a time? Not understanding how that can be. What you want can probably be done, but unless I'm misunderstanding the design and goal, it shouldn't be required. This should probably be a main/subform design, with project details (including a single? value for phase) in the main form. The subform would show the hour records by date.
    BTW - if those are your real field names, suggest you change them. Date and Name are reserved words. See http://allenbrowne.com/AppIssueBadWord.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    an application to register hours worked on projects which run through phases.
    You don't need to know who worked those hours?

  6. #6
    toreberg is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    4
    Quote Originally Posted by Micron View Post
    A project can be in more than one phase at a time? Not understanding how that can be. What you want can probably be done, but unless I'm misunderstanding the design and goal, it shouldn't be required. This should probably be a main/subform design, with project details (including a single? value for phase) in the main form. The subform would show the hour records by date.
    BTW - if those are your real field names, suggest you change them. Date and Name are reserved words. See http://allenbrowne.com/AppIssueBadWord.html
    Thank you for your answer!
    One project goes through many phases during it's lifetime, but of course can't be in several phases at the same time
    In my plan I operate with hours available in each phase and to keep record of hours left I need to keep track of hours used in different phases of the project.
    This is what my database is to be used for
    I will try the suform approach.
    Thanks again!

  7. #7
    toreberg is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    4
    Quote Originally Posted by orange View Post
    You don't need to know who worked those hours?
    Right now I just need it for some small projects where I am the only worker
    But for sure it would be more flexible if more people could use it for project teams

  8. #8
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    toreberg,

    It is more efficient if you build a model of your proposed application. Identify the things involved in the application, and how they relate to each other. These are the "business rules". If you don't know all the details, then make a "black box" and identify where it fits and the general concept of what's in that box. Make a high level model so you don't forget or overlook any of the components.
    Test the model with sample data. Build the database/project based on your priorities, but keep the big picture in mind, so that those things to be built/accommodated "down the road" are not forgotten.

    You can check some of the articles in this link on Database Planning and Design for details and examples to help.

    Good luck with your project.

  9. #9
    Join Date
    Apr 2017
    Posts
    1,687
    Quote Originally Posted by toreberg View Post
    I have this access database
    tblProjects:
    .id
    .name
    OK! But better name id > ProjectID!
    TblProjectphases
    .id
    .name
    .project
    Add a field
    .PhaseFrom (a start date of phase)! And id > PhaseID, project > ProjectID
    tblHours:
    .date
    .project
    .projectphase
    .hours

    Add HoursID! And replace project > ProjectID!
    No need for projectphase here - you can read it from tblProjectPhases (by ProjectID and Date)

    You create a single form based on tblProjects. The form has Tab control with tabs which have continous subforms linked to projects form - one for entering hours and second for entering phases.
    On tab with hours subform (but ouside of subform), you have an unbound control where you can enter date.
    ProjectPhases subform is linked with Projects form by ProjectID;
    Hours subform is linked with Project form by ProjectID and unbound date control. Next to unbound date control you may have another unbound control, which displays project's phase at this date (e.g.using DLookup)

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

Similar Threads

  1. Return current value from a combobox
    By Joakim N in forum Forms
    Replies: 5
    Last Post: 10-13-2016, 10:52 AM
  2. Replies: 11
    Last Post: 03-31-2016, 09:19 AM
  3. Replies: 3
    Last Post: 11-22-2015, 11:01 AM
  4. Combobox Wizard synch with Current Record.
    By MatthewGrace in forum Programming
    Replies: 3
    Last Post: 05-23-2014, 01:11 AM
  5. Replies: 3
    Last Post: 04-18-2014, 12:20 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