Results 1 to 4 of 4
  1. #1
    kmims44 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    24

    finding value of one field associated with a combo box for another


    I am attempting to create a form that has the following: I have multiple combo boxs to select "EmployeeAlias" (which is just first inital and last name of the employees) to thr right of each combo box I have text boxes labeled "Hours Needed" where the use can enter a numerical value. Now, what I want to happen is when the user is done filling out the form I want them to click a button that will multiply the Employees' labor rate by the number of hours they enter without displaying what each employees' labor rate actually is. How do I accomplish this? Do I need to have the labor rate field on the form as well and just hide it or do I have to use a command button to run VB to do a lookup of some kind?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    If the labor rate Field is included in the RecordSource for the Form, you can reference it as if it actually were on the Form, using the syntax Me.LaborRate.

    If the labor rate Field were not included in the RecordSource for the Form, you'd use the DLookup() function to retrieve it.

    Linq ;0)>

  3. #3
    kmims44 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    24
    i can accomplish my calculation for a single employee but I want the user to be able to select multiple employees on the form and I cant seem to create seperate form fields for each employee selection to calculate separately

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    This really shouldn't be done using a Command Button and calculating the pay for all employees at one time. It should really be done by placing the Calculation in the AfterUpdate event of the Control where the Hours are entered. Then, as each employee's Hours are entered, the Calculation will be done automatically.

    Linq ;0)>

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

Similar Threads

  1. Replies: 4
    Last Post: 03-29-2012, 07:06 PM
  2. Replies: 2
    Last Post: 06-11-2011, 10:39 PM
  3. Replies: 4
    Last Post: 10-15-2010, 07:50 AM
  4. Replies: 5
    Last Post: 08-07-2009, 05:23 PM
  5. Finding highest value in a text field
    By cdominguez in forum Queries
    Replies: 3
    Last Post: 06-02-2009, 09:39 AM

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