Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Assign a value to a number
Mcarthur Sewell 
     
3 years ago
Hello. Im a beginner but Ive probably watched about 50 videos and have created a few access databases but I havent seen any videos so far that would help me assign a value to a field by a multiple of .5 hours.

For example, I want to be able to assign man hours to a difficulty level (lets call it DifficultyID). So, a DifficultyID value of 1 should equal .5 in the ManHoursID and 2 should equal 1hr and so on, and so on.

So far I created a DifficultyT table with a DifficultyID from 1 to 5 and a ManHoursT table with a ManHoursTotalID from 30 to 150 (since Richard says dont use increments of hours). I also created a DifficultyID in the ManHoursT table as the foreign key. After that, its all hazy for me.

I want the end result to be that Whenever I assign a DifficultyID in a combo box for that activity, I want the difficulty level to reflect that .5 respective  multiple. In other words, if 5 is chosen in the difficultyID, I want the man hours to equal 2.5 hours. And eventually, a want to sum several difficultID values (jobs) in a total sum (total man hours).

I hope I explained this right but thats what Im hoping for some guidance on. Thanks!
Alex Hedley  @Reply  
           
3 years ago
Scott Axton  @Reply  
        
3 years ago
You are right in my opinion to be storing minutes.  Saves you a conversion step down the line for adding up the time.
What you are describing is really just building a reference matrix / table to guide yourself.

Having is in a separate table is good as well from the stand point of making changes. Say that in the future you decide that D1 really needs to be 40 min not 30 or you need to add a D6.  Easy enough to do.

In addition to the video Alex suggested also take a look at the DLookup, DSum, DCount
Dan Jackson  @Reply  
            
3 years ago
Hi Mcarthur,

What you are looking for is DLookup. You put in DifficultyID 1 and the text box (Set it to locked in the properties) next to it shows 30 (Mins).

I'm not sure why you have done two separate tables? I'd have one table like

DifficultyID     DifficultyDesc (Optional)     Minutes
1                   Very Easy                          30
2                   Easy                                 60
3                   Normal                              90
And so on...

Then on your form, add the Relational Combo (Note, you can just use the one column for the ID if you want OR you can use the tips in this video to have captions next to those id's if you want. Very Easy, Easy, Standard, Morately Difficult, Very Difficult....). Finally, Add a textbox to show the minutes (In this example, My combo is called Combo_DifficultyID and the textbox is called Text_Minutes)

Click the combobox, go to events and the code builder. In there:

Text_ManMinutes = DLookup("ManMinutes", "Table1", "DifficultyID=" & [Combo_DifficultyID])

You can then add another textbox and just put =[ManMinutes]\60 to show in hours.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 6:50:56 PM. PLT: 0s