Results 1 to 6 of 6
  1. #1
    mojahed.mroteza is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    3

    Answer abuot Combo Box

    hi guys first excuse me for my language becuse im Afghan


    i have 2 comboBox in My forms One of them name Duty and it get data from tab_emp ;and others combo name is state and get data from other table
    I will when i chose duty(for example:teacher) ,comboBox state just show data about teacher(for example:techear-calss1,techear-calss2,techear-calss3)
    model
    Database51 (en).zip
    tank u for all

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    These are dependent comboboxes. Review this tutorial http://datapigtechnologies.com/flash...combobox2.html
    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
    mojahed.mroteza is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    3
    tank u for ur answer but this answer for 1 table my form have 2 table please review my form tank u my master.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Doesn't matter that two tables are involved, concept is the same.

    The Group and Duty fields hold the common linking data. You have the Group field in Tab_Grade as text and save the descriptive value from Duty field of Tab_TypeEmployment, not the number Grade. However, the Duty combobox is bound to the number Grade field, not the Duty field. Since the State combobox must refer to the value of Duty combobox as criteria, no records will return because nothing in Group will match the Grade values.

    Need to either save the Grade value into a number field of Tab_TypeEmployment or remove the Grade field from RowSource of Duty combobox. Since the Duty values are short could just keep saving them in Tab_TypeEmployment and eliminate the number Grade field. Why is Grade just a number type, not even autonumber?

    RowSource for State combobox:
    SELECT Tab_Grade.[Tab-emp], Tab_Grade.state, Tab_Grade.tm FROM Tab_Grade WHERE (((Tab_Grade.Group)=[Forms]![Form1]![CboVazife]));
    You retrieve 3 fields but have set for 2 columns.

    You have 'student' in Tab_TypeEmployment but 'students' in Tab_Grade.
    Last edited by June7; 07-14-2012 at 11:06 AM.
    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.

  5. #5
    mojahed.mroteza is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    3
    do u have any sample from this project???? thank u

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Just make the changes I described.

    Duty combobox properties:
    RowSource: SELECT Tab_TypeEmployment.[duty] FROM Tab_TypeEmployment;
    ColumnCount: 1
    ColumnWidth: 1"
    BoundColumn: 1

    State combobox properties:
    RowSource: SELECT Tab_Grade.[Tab-emp], Tab_Grade.state, Tab_Grade.tm FROM Tab_Grade WHERE (((Tab_Grade.Group)=[Forms]![Form1]![CboVazife]));
    ColumnCount: 3
    ColumnWidth: 0.5";1";0.5"
    BoundColumn: I am not sure which value you want the combobox to have
    Width: 2
    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.

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

Similar Threads

  1. SBA IT national Elections answer
    By Paula in forum Import/Export Data
    Replies: 2
    Last Post: 10-22-2011, 07:29 AM
  2. Database challenge: can you find the answer?
    By Cholomanchuten in forum Access
    Replies: 5
    Last Post: 08-05-2011, 12:27 PM
  3. There should be an easy answer, Please Help.
    By tucker1003 in forum Database Design
    Replies: 3
    Last Post: 03-03-2011, 01:03 PM
  4. Getting wrong answer when comparing numbers
    By cowboy in forum Queries
    Replies: 7
    Last Post: 05-18-2010, 01:42 PM
  5. Substitute Teacher in need of answer key!
    By misssunshine1973 in forum Access
    Replies: 4
    Last Post: 05-14-2009, 02:25 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