Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15

    Unhappy Help I need somebody lol...

    Hi there, seriously I need help with a table and form. In short I want to know if I can modify a query to return all duplicates but only if it matches a combo box entry if so can I then have the query add the matching data to the same table?


    I have a table of customer names and a macro to run a query to find duplicate names from my table after update. I just don't want to keep typing all the details when they are already there basically. So say Mike called and on my form I typed mike into the combo box instead of all the duplicates appear Can I modify it to show only customers called mike?

    PHEW!

    Oh btw I don't now anything about sql or vba and would be really appreciative of any help given.

    Thanks in advance (Fingers crossed)

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I don't really understand what you mean about 'duplicates' and 'add the matching data'.

    Your requirement might be concerning filtering the form's RecordSource with the selected criteria. Check this tutorial http://datapigtechnologies.com/flash...tomfilter.html

    If this is not what you need, please explain more clearly what you do need. You could also attach the project to post.
    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
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15
    Thanks for the help, the tutorial is close to what I want, just trying to figure out how to implement it. I'll get back to you and let you know how I get on.

    Cheers

  4. #4
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15
    Hmmmm not happening and I feel I'm really close. Ok I have a split form to book jobs from passengers on. The first combo box is for passenger name, now after this combo box has updated a macro runs a query to find all duplicate records in the booking table. I need this to happen so I can see any repeat jobs and take the info from there instead of typing it all out again. But I don't want to see all the duplicates only those with the same passenger name as my passenger name combo box on my form, so if a call comes in from ken, I type ken into the first box, the macro runs the query and identifies all the jobs done for anyone named ken.

    Hope this makes sense.

    Cheers

  5. #5
    RedWolf3x is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jul 2011
    Posts
    31
    So if I'm following you correctly, and if you are running a query already it seems all you should have to do is add a where statements to the query.


    Where Mytable.passenger = Forms![My Form]![passenger name]

    Keep in mind the "My Table" "My Form" and "passenger name" are all parts of your database, I just used generic names.

    Hope this helps.

    -Red

  6. #6
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15
    Cheers Red, will try this in a mo, sounds promising ooooh cant wait.

    Thanks

    keels

  7. #7
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15
    Ok am a total dick I know but erm where do I put the where statement?
    At the end of the original criteria string or in a separate field?

  8. #8
    RedWolf3x is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jul 2011
    Posts
    31
    Select (statement)
    From (statement)
    Where (statement)
    Group By (statement)
    Order By (statement)

    The last 3 are all optional but they help filter your query.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Query in Design View.

    On the Where row under the appropriate field.
    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.

  10. #10
    RedWolf3x is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jul 2011
    Posts
    31
    Thanks for the assist June, I use the SQL editor so much I forget others don't.

    -Red

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I use both but the designer helps get basic SQL constructed faster.

    Am surprised you could be comfortable with the SQL editor and not know how to include the WHERE clause. You might find this tutorial site of interest http://www.w3schools.com/SQl/default.asp
    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.

  12. #12
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15
    Hmmmm, don't have a row named where in the field, will show you screenshots of database this may help.

  13. #13
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    In the Query Designer it's labeled Criteria

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Sorry, it is the Criteria row. WHERE is an option of Total row in a GROUP BY query. Access Help has guidelines on using the query designer and wizards.
    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
    keels is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    15

    Talking

    Quote Originally Posted by June7 View Post
    I use both but the designer helps get basic SQL constructed faster.

    Am surprised you could be comfortable with the SQL editor and not know how to include the WHERE clause. You might find this tutorial site of interest http://www.w3schools.com/SQl/default.asp
    Am not comfortable with the editor, I used the wizard in 2007 and I'm fumbling my way round, admittedly I have learned a fair bit of the basics in access and excel since becoming unemployed 2mths ago. But code of any kind baffles me, what's the saying about OLD DOG New Tricks that's me lol, sorry.

    Akeel

    P.S. thank you both for the help, if only the whole world where like this hmmmm

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

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