Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9

    Limiting list box by another field

    Hello!

    I'm trying to limit the funders under previous applications to ones with the same name so then when you click on one it loads that other funding application details...Could anyone tell me where I'm going wrong please?


    Code:
    SELECT [Sheet1].[ID], [Sheet1].[Funder] FROM Sheet1 WHERE [Sheet1.Funder] Like [Sheet1].[Funder] ORDER BY funder;
    Code:
    [Sheet1.Funder] Like '" & [Sheet1].[Funder] & "*' ORDER BY funder;


    Code:
    SELECT [1].[Funder] FROM 1 WHERE [Sheet1.Funder] Like [1].[Funder] ORDER BY funder;


    Code:
    SELECT [Sheet1].[Funder] FROM 1 WHERE [1].[Funder] Like [Sheet1].[Funder] ORDER BY funder;
    Code:
    SELECT [Sheet1].
    [List89] FROM [Sheet1].Funder WHERE [1.Funder] Like [Sheet1].[Funder] ORDER BY funder;


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is this what you want to do http://datapigtechnologies.com/flash...combobox2.html

    If you don't use LIKE operator with wildcard (*) might as well just use = operator.
    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
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Hello, thanks for your reply

    not quite

    There are some entries with identical Funder names, when I am on an entry which has more than one with the same name I would like the others to appear in the previous application box so when I click on one of them it goes to that entry.




    Uploaded with ImageShack.us

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You want the listbox (unbound) dependent on the value in the Funder combobox? Then you want the form to filter based on value selected in the listbox? This is one way to do the filtering http://datapigtechnologies.com/flash...tomfilter.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.

  5. #5
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    I tried the tutorial, but it didn't seem right. The Funder is just a field which displays whatever the Funder is for that particular entry. What I want the listbox (unbound) to do is show all entries with the same funder name in there so when I click on a 'previous application' it changes to that one.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Do you want to provide project for analysis? Follow instructions at bottom of my post.
    Last edited by June7; 04-26-2012 at 12:21 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.

  7. #7
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    databasecopy.zip

    (None of the data is confidential)

    Thanks

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If I understand the setup you have attempted: You want the listbox restricted to records for the Funder shown in textbox and at the same time you want the form filtered to record selected in the listbox. This is essentially circular referencing and won't work. I should have recognized much sooner that was what you were attempting.

    The entities of this data appear to be Funders and Projects. The relationship appears to be many to many. Each funder can have many projects and each project can have many funders. You need 3 tables: Funders, Projects, FundersProjects. Then use form/subform arrangement for data entry/edit. Review http://office.microsoft.com/en-us/ac...101872705.aspx
    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.

  9. #9
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Hello I wondered if you could advise me on my progress at all - When someone creates a new application I want it automatically to link to the Funder they're on by having the same funder name under previous applications. I also want the previous applications to be in a drop down box, e.g. all the entries in the project table are displayed if they have the same name as the current field in the funders table/form. They when you click on one it changes to that entry?

    Thanks

    Database4.zip

  10. #10
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Also rather than going to the next project when clicking through the records it repeats the same funder without changing the project?

  11. #11
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Database5.zip

    Sorry... Newer neater version attached

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You have the autonumber field designated as primary key but are saving the funder name as the fk value in projects table. That will work but makes a very long pk. If you want it this way then need to change Funder field to the pk.

    However, if the relationship is many to many this is not correct setup. Many to many requires a third junction table to associate the two entities.

    With the proper relationship setting and form/subform arrangement, listbox is not needed.
    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.

  13. #13
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Hi, its excatly how I want it except I want when someone creates a new application I want it automatically to link to the Funder they're on by having the same funder name under previous applications.

    I also want the previous applications to be in a drop down box, e.g. all the entries in the project table are displayed if they have the same name as the current field in the funders table/form. They when you click on one it changes to that entry?

    Adn I'm quite confused how I would do this

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe this is what you want. Have an unbound combobox named like cbxApplications in Projects form header section with RowSource:
    SELECT Projects.Project FROM Projects WHERE (((Projects.Funder)=[Forms]![Funders]![Funders_Funder]));
    This combobox value can be used as criteria to filter Projects form with code in the AfterUpdate event of the combobox. Consider this approach:
    Private Sub cbxApplications_AfterUpdate()
    Me.FilterOn = False
    Me.Filter = "Project='" & Me.cbxApplications & "'"
    Me.FilterOn = True
    End Sub

    And behind the Funders form:
    Private Sub Form_Current()
    Me.Projects.Form.cbxApplications.Requery
    Me.Projects.Form.FilterOn = False
    End Sub

    Suggest you also move the control buttons on the Projects form to its form header section.
    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.

  15. #15
    lukebowes is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Apologies for the late reply and thank you so much for help so far!

    I've done as suggested however it still throws an error?Database6.zip

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2012, 08:39 PM
  2. Replies: 3
    Last Post: 03-12-2012, 09:19 PM
  3. Limiting Duplicates
    By Zerdan in forum Forms
    Replies: 4
    Last Post: 06-07-2011, 09:29 AM
  4. limiting number?
    By vespid in forum Database Design
    Replies: 1
    Last Post: 01-10-2011, 10:34 PM
  5. Replies: 4
    Last Post: 07-28-2010, 10:27 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