By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 1,952 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

right SQL statament

P: 47
I have a form that has a subform which display data for a totalize query, in the main form I filter the data displayed by the subform, so far its fine , now I'd like to open the form where the totalize line is based , I wrote a macro that on click over the totalized line opens that form but I cant figure out how the WHERE condition be constructed , I used [Forms]![SubformName]![SubformFieldName], but it doesn't work, then I changed for [Forms]![FormName]![SubformFieldName] but still no working

could somebody help me please


Raymundo Walle
May 12 '10 #1
Share this Question
Share on Google+
3 Replies

P: 23
Not sure if I totally understand what you are doing, but perhaps this would work:

In your onclick event (Code Builder) -

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "totalize_form_name", acNormal, , , acFormEdit, , Me.SubformFieldName
May 12 '10 #2

P: 23
Sorry, I forgot to say that in your form "totalize_form_name" you will need to have a textbox to hold the openargs value you are passing it (the textbox can be not visable if you want).

Let's say the textbox is txt_OAV. In the OnLoad event for the form "totalize_form_name" enter the code below:

Expand|Select|Wrap|Line Numbers
  1. Me.txt_OAV = Me.OpenArgs
Then in the query to gather all your totalized data you can use

Expand|Select|Wrap|Line Numbers
  1. WHERE [totalize_ID] = [Forms]![totalize_form_name]![txt_OAV]
May 12 '10 #3

P: 47

Thanks for your replay :

actually my doubt was about build the rigth where SQL in order to open the detailed form where the totalized subform is based , browsing the answers I found
and it worked for me

Thanks and Best Regards

Raymundo Walle
May 19 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.