Help with append query

Niniel

Registered User.
Local time
Today, 11:49
Joined
Sep 28, 2006
Messages
191
Hello,

Could somebody please tell me how to write my Where statement without specifically mentioning the exact name of the parent form?

This is what I have right now:
WHERE (((tblOptions.OptionsID)=Forms!frmBrowseApplications!sfrmOptions!OptionsID));

It works, but I'd like to get rid of "frmBrowseApplications". And "sfrmOptions" as well if possible. I've been experimenting with "parent" and "me", but either that can't be done or I just haven't hit the jackpot yet.

Thank you.
 
You have to reference the form and subform so access knows which control contains the value for the criteria.
 
So if I understand you correctly, I *have* to provide the complete path to the control, and shortcurts like "me.textbox" won't work?
 
Correct the keyword me will only work in the class module behind a form or report.
 
That is too bad.
Oh well, thank you for clarifying that for me.
 
niniel,

what you could do instead of referring to forms, is to save the value in a global variable and get it from there.

------------
in a module define a variable and a function to read it

eg

public myvar as string

function readmyvar() as string
readmyvar = myvar
end function

now in your form, set the variable myvar

and in your query, instead of the forms! etc syntax, you can read the variable retrieving function (you have to do it like this, becuase access cant use the variable directly)

instead of the forms! syntax put =readmyvar() - the brackets are necessary.
 
Oh, that's a neat idea, thank you! I shall certainly give it a try.
 

Users who are viewing this thread

Back
Top Bottom