Gustav Brock
Gustav at cactus.dk
Fri Feb 8 02:02:09 CST 2008
Hi Vlad Thanks! Glad it worked for you. About the truth of your statement, we better check it out with the higher powers ... /gustav >>> actebs at actebs.com.au 07-02-2008 23:58 >>> Gustav, Many thanks. That did the trick. You're a GOD! Regards Vlad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, 4 February 2008 6:02 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Open Query Within Form Hi Vlad I think what most do is to reassign the ControlSource for the TextBoxes (named sequentially) in the (sub)form - DataView or not - to the field names of the recordset from the query, as this: intFields = Fields.Count - 1 For intField = 0 To intFields Me.Control("PrefixOfControlName" & CStr(intField)).ControlSource = rst.Fields(intField).Name Next You may need to have the control sources initially to be empty. /gustav >>> actebs at actebs.com.au 04-02-2008 05:09:54 >>> Hi Everyone, Just wondering whether it is possible to open a query within a form? Strange request I know, but a simple Datasheet form won't work because the field names for the query are changed programmatically on fly each time the user changes the criteria. For example he/she might choose data between Jan 2007 to Dec 2007 and I recreate the query on the fly with field names Jan 07, Feb 07, Mar 07 etc etc I hope that makes sense. Any help will be most appreciated. Regards Vlad