[AccessD] A2K: Pass Field Name to function

Michael R Mattys michael.mattys at adelphia.net
Wed Apr 9 23:14:34 CDT 2003


Hi Darren,

Just out of curiousity, would this work?
 Forms(stDocName).RecordsetClone.FindFirst _
"'" & Me.ActiveControl.Name & "' = " & Me.ActiveControl.Value

Michael R. Mattys
www.mattysconsulting.com

----- Original Message ----- 
From: "Darren DICK" <d.dick at uws.edu.au>
To: <accessd at databaseadvisors.com>
Sent: Thursday, April 10, 2003 12:08 AM
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


More information about the AccessD mailing list