Chris Mackin
chris at denverdb.com
Wed Apr 9 23:14:08 CDT 2003
Use this instead: Forms(stDocName).RecordsetClone.FindFirst stFieldToFilter & " = " & Me.ActiveControl of course you will want to make sure that you watch out for Text or Date data type in thos fields, which require the 'Value' or #Value# instead of the above which will work for a numeric Field. Chris Mackin Denver Database Consulting, LLC www.denverdb.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Darren DICK Sent: Wednesday, April 09, 2003 10:09 PM To: accessd at databaseadvisors.com Subject: [AccessD] A2K: Pass Field Name to function Hello all The commented code below works fine. That is if I type the FieldName in directly What I want to do is pass in the FieldName from passes parameters I just can't get the syntax right. Any help or suggestions would be most appreciated Many thanks Darren __________________________________________________ _________________________ Function fComboDoubleClick(stFormToOpen As String, stFieldToFilter As String) <code Snip> DoCmd.OpenForm stFormToOpen ' This line works 'The line below works when BroadcastTypeID is typed in Manually 'Forms(stDocName).RecordsetClone.FindFirst "[BroadcastTypeID ]=" & Me.ActiveControl 'The line below fails whan I try and pass the field name as a parameter Forms(stDocName).RecordsetClone.FindFirst " & stFieldToFilter & = " & Me.ActiveControl <code Snip> __________________________________________________ _________________________ _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com