Results 1 to 6 of 6
  1. #1
    putte11 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    18

    Combobox with texbox as criteria

    Ok I have 3 tbls Proj, Cust, C-empl. Cust consists of C-Id,C-name. C-empl consists of Emp-Id, C-Id, Firstname.
    Proj consist of Proj-no, Description, C-Id, C-responsible.
    I make a projectform where I put a textbox for all positions in proj, but for c-resp I want a combobox based on wich customer I choose in C-Id.
    I made a Query selection from tbl C-empl with C-Id and firstname. C-Id has criteria [Forms]![Projectform][C-id].


    When I run this I get askedfor [Forms]![Projectform][C-id] and if I enter 2 I get the right names for cust 2 in my combo.
    I want it to change when I change customer in the C-id box.
    This is the short version with the problem condensed the rest is working properly.
    1 Why doesnt it pick up my textbox value ?
    2 Do I need to make som sort of update when clicking the combo?
    Patrik

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Missing ! or . from the reference: [Forms]![Projectform]![C-id]

    Yes, need code to requery the combobox RowSource. Review 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
    putte11 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    18
    Been away!
    Still dont know where I go wrong.
    Ok here is my db and my problem.
    HUVUDFORM, Tab PROJ , in the top right textbox Kund-Id I want to choose a customer no.
    Then 2 steps down in combo Kontaktpers I want to pick an employe from this company.
    Right now the combo isn´t working at all.
    Thanks Patrik
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Kund-ID is not a combobox but should still be workable.

    Syntax for Kontktpers RowSource is wrong. Remove quote marks and the form prefix is not necessary.

    SELECT [K-anst ID], [Kund-Id], [K-anst].Förnamn FROM [K-anst] WHERE [Kund-Id]=[Kundval];
    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
    putte11 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    18
    Brilliant thanks, I have now clue where the quotes came from. Thought I hade to have the full path to kundval.
    ( shouldnt that work anyway).

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The full path not needed in this RowSource SQL because the controls are on same form.
    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. Filter Using ComboBox For Date Criteria
    By burrina in forum Forms
    Replies: 12
    Last Post: 11-29-2012, 08:02 PM
  2. Combobox value as query criteria
    By tylerg11 in forum Forms
    Replies: 5
    Last Post: 06-25-2012, 10:45 AM
  3. click label -> append text to texbox
    By cnstarz in forum Access
    Replies: 5
    Last Post: 06-15-2011, 06:09 AM
  4. Query criteria retrieved from a Form combobox?
    By blacksaibot in forum Queries
    Replies: 1
    Last Post: 01-27-2010, 10:18 AM
  5. Criteria from Combobox dont work.
    By Ryan in forum Queries
    Replies: 3
    Last Post: 08-31-2009, 07:09 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