Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2008, 01:25 PM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default Solved-RS.FindFirst and Multiple Column ComboBox

Hello All:

I am using Access XP. I have an unbound combo box that is set for displaying three columns and the bound column is one. I have a query in the rowsource as follows:

SELECT DISTINCT [OrderName], [PrimaryWorkGroup], [SecondaryWorkGroup] FROM Orders ORDER BY [OrderName], [PrimaryWorkGroup], [SecondaryWorkGroup];

Here is what I have in my after_update subroutine:

Private Sub cbosOrderName_AfterUpdate()
Set rs = Me.Recordset.Clone
rs.FindFirst ("[OrderName] = '" & Me![cbosOrderName] & "' AND [PrimaryWorkGroup] = '" & Me.cbosOrderName.Column(3) & "' AND [SecondaryWorkGroup] = '" & Me.cbosOrderName.Column(4) & "'")
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

All it does is select the first record. I can have multiple PrimaryWorkGroups or SecondaryWorkGroups. I am missing something.


Thank you for any advice,
Tony

Edit...I always forget about the wizard. I used it and it worked fine.

Thanks,
Tony





Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved - rs.FindFirst and Multiple Column ComboBox eusanpe Access VBA 1 May 20th, 2008 03:21 PM
SOLVED -- Overriding OnTextChanged of ComboBox dparsons C# 1 January 17th, 2007 02:50 PM
update multiple records (solved) dhaywirex Classic ASP Databases 2 February 24th, 2004 12:23 AM
Multiple column for combobox in C# twaghorn C# 1 July 14th, 2003 04:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.