Arthur Fuller
artful at rogers.com
Wed Feb 26 07:06:09 CST 2003
I think there's some misunderstanding here (could be on my part :-)). Does your form have, say, a combo or list that is the form's navigation scheme? Such that you select a row in the list and then the form navigates to that record? Or are you passing the selection to another form that you want to filter? If it's the same form, you'll need: a) a view or sproc that populates the list with PK and description; b) a sproc that drives the form, and that accepts an int parameter @PK. Within the sproc, default the parameter @PK to zero. The code for the sproc should resemble this: CREATE PROC myProc ( @PK integer = 0) AS SELECT * FROM myTables WHERE (PK = @PK) In the InputParameters property, write "@PK = " & Me.cboName. In the AfterUpdate event of cboName, requery the form. It's dead simple, and leaves all the data you don't want on the server where it belongs. HTH, Arthur -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] Sent: February 25, 2003 7:08 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Bound forms filtered on a control on the form Hmmm... OK. My understanding is that this actually pulls all of the records in the recordset and then only DISPLAYS one record (filter). That is useful in certain instances, however I would really like to just pull one specific record, having SQL Server do all the work of finding that record and handing it back. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Selina Iddon Sent: Tuesday, February 25, 2003 5:31 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Bound forms filtered on a control on the form Hi John I may be reading the question wrong, but would this help? Sub MyComboControl_AfterUpdate() Me.Filter = "FieldName = " & Me.MyComboControl Me.FilterOn = true End Sub Cheers Selina ---------------------------------------------------------------------------- ---- Selina Iddon selina at easydatabases.com.au Ph: 0414 225 265 Easy Access Databases ----- Original Message ----- From: "John W. Colby" <jcolby at colbyconsulting.com> To: "AccessD-SQLServer" <dba-sqlserver at databaseadvisors.com> Sent: Wednesday, February 26, 2003 7:53 AM Subject: [dba-SQLServer]Bound forms filtered on a control on the form > I have been following the thread on the report thing. The discussion has > focused (the ones I have read) on using XP, where there are actually > properties to do this. How do I do this in A2K? > > I have a form. I want to select a record in a combo box. Having selected > that record, I want to run an sproc, passing a parameter to filter the data > returned to only return the record selected in the combo box. > > How do I do that in A2K? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > ---------------------------------------------------- > Is email taking over your day? Manage your time with eMailBoss. > Try it free! http://www.eMailBoss.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 6352 bytes Desc: not available URL: <http://databaseadvisors.com/pipermail/dba-sqlserver/attachments/20030226/b7b5406b/attachment.bin>