Strings in expressions

PhillipsAndrew

Registered User.
Local time
Today, 20:56
Joined
Aug 7, 2003
Messages
21
I'm trying to requery an underlying form using the form name passed by OpenArgs. There's no problem getting the form name, my problem is how can I use this string in the expression to requery the underlying list when I delete records?

Example:

strCallingForm = [Forms]![MEC Approval].OpenArgs 'works fine

I then want to do:-
Forms![MEC Approval List]![FullList].Requery

but replace 'MEC Approval List' with the string for the calling form...
I tried..
Forms(strCallingForm)![FullList].Requery

and loads of variations of syntax, but each time I get an error.

This form is called from several places so using OpenArg seems like a elegant solution.

Any help on the syntax much appreciated

P
 
Try:

Code:
Forms("[" & strCallingForm & "]")![FullList].Requery
 
And that's why we don't put spaces in field names, object names, etc.

Simple little errors like that. Because your form name has spaces within it we have to enclose it within Square Brackets.
 

Users who are viewing this thread

Back
Top Bottom