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 10th, 2005, 07:50 AM
Authorized User
 
Join Date: Jun 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default Altering a recordsetclone search??

Hi I hope you can help.

I have two list boxes on a form. The first one displays record id numbers for selection (Combo74). On selection of a number the following routine is run:


Sub Combo74_AfterUpdate()
    ' Find the record that matches the control.
    Me.RecordsetClone.FindFirst "[CaseNoteNo] = '" & Me![Combo74] & "'"
    Me.Bookmark = Me.RecordsetClone.Bookmark

    Me.Combo96.Requery

End Sub

Within the table there can be multiple records with the same record id number. Each of these records have a unique date within it. What I would like to do is select a record id number from one list box, another list box (Combo96) will then display all the relating dates for this id number - on selecting the required date a form will display the correct record.

OR

Would it be easier to setup a subform?????

Hope I have explained this ok.....

Many thanks

Tim

Tim
__________________
Tim
 
Old May 15th, 2005, 10:03 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

Tim,

To provide a dropdown of only those dates that are related to the selected case, you need to set the RowSource for Combo96. The way to do this would be to put the following before your "Me.Combo96.Requery"

Me.Combo96.RowSource = "Select fieldlist from table WHERE [CaseNoteNo] = " & Me.Combo74.Columns(0)

Whether or not you use a subform depends on your application. It appears you're having the users select a case number to potentially view or edit information that occurred on a specific date. I'm thinking the subform is probably the way to go. But if you want the subform to display data for a specific date instead of all dates, you probably need to include this date select functionality. Then your subform will be linked to both the case number and the selected date.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
 
Old May 15th, 2005, 10:23 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

That should be Me.Combo74.Column(0) (not Columns)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Altering a listbox from another form Firestorm9 C# 2005 1 July 9th, 2007 06:12 AM
Dynamically Altering a Child Control's Method forkbeard ASP.NET 2.0 Professional 2 May 15th, 2007 07:13 PM
Altering the Identity seed value g_vamsi_krish SQL Language 2 July 7th, 2006 12:58 AM





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