Results 1 to 4 of 4
  1. #1
    Hardrock is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    27

    Combo or list box on a form to select a role/name from a table or query

    A form is used to enter details about an organization in a table. These details include name and contact info on the chairperson and treasurer. The names are stored in the fields "Chair" and "Treasurer"



    A report needs to show the name of one or the other of these (chair and treasurer)....depending on who is going to sign the hardcopy of the report.

    Can/should I use a combo or list box in the form to let a user indicate which of the officers will be signing? I'm trying to set this up so that the ROLES "chair" and "treasurer" appear in a combo box in the form and based on the users selection, the actual NAME of the chair or treasurer will show up on the report.

    OR is there a better way to get the name of one of the two officers in the report AT THE TIME THE REPORT IS RUN?

    Based on report requirements, the user MUST use the form any time the report is run since there are variables that must be input each time the report is run.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is there data in the report that can be used as criteria to determine which officer will sign? If not, then user must select. The report can reference the combobox by expression in textbox.


    Or the name can be passed to report in OpenArgs argument of OpenReport.
    DoCmd.OpenReport "report name", , , , , Me.comboboxname

    Then expression can reference OpenArgs.
    =[OpenArgs]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Hardrock is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    27
    OK, I have a Chicken/egg issue here. I figured I can't use a combobox to choose a name on a form that I'm using to enter the name so instead my combobox lets user choose a role (which corresponds to a field in the table). So user chooses "Treasurer" which I'm storing in the table in a field called "Signer". How do I get the content of the signer field (which is treasurer) to help me get the actual NAME of the treasurer to show up on the report?

  4. #4
    Hardrock is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    27
    Solved. Here's the if/then statement I used to get the desired result:

    =IIf([Signer]="Treasurer",[Treasurer],[Committee Chair])

    So, depending on which ROLE the user specifies as the person who will sign the report, the name that corresponds to the role appears in an unbound text box in the report.

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

Similar Threads

  1. Select All in Combo Box List
    By kdub in forum Forms
    Replies: 9
    Last Post: 10-30-2014, 09:50 AM
  2. Add a combo box to select from a list
    By Sonny101 in forum Forms
    Replies: 12
    Last Post: 06-26-2014, 10:40 AM
  3. Combo Box Won't Select Last Item in List
    By Autumn227 in forum Forms
    Replies: 9
    Last Post: 12-18-2013, 02:37 PM
  4. Replies: 13
    Last Post: 09-07-2013, 04:57 PM
  5. Combo box to Select Table to Query
    By RedWolf3x in forum Programming
    Replies: 3
    Last Post: 11-15-2012, 04:31 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