Parameterized View - Can we open multiple instances using aliases?

Posted on 2010-03-29
Medium Priority
Last Modified: 2012-06-21
I have a parameterized view (called ACCOUNT_PRICESET) which works as advertised.

However, in one of my routines, I open the view and use it update other versions of the same view.

(if it helps to understand, the first view is the Price Rules for a head office and we need to create a copy of that set of rules for each subsidiary account assigned to that head office. Why? Because the subsidiaries are allowed to modify some of the rules but their starting point is what the head office negotiated)

The parameter is simply the Account Reference (PRICESETS.ACCREF=?startit.current_accref is the SQL code). So I open the head office view with the parameter set to the head office account ref. Then I change "startit.current_accref" to one of the subsidiary accounts  and use the following command


expecting a new small view consisting, this time, of the subsidiary's price set records.

Instead, what I'm getting is another copy of the Head Office records, despite the change in parameters.

This is, I think, the first time I've tried opening a parameterized view while there is already one open, so perhaps I'm breaking some rule I don't know about or, perhaps there is a procedure that will accomplish what I need in some other way.

I could, for example, set up an identical view with a different name, just for this purpose, which would be simple enough, but I'd like to understand why I can't do it as above...

Question by:mjacobs2929
LVL 43

Accepted Solution

pcelba earned 2000 total points
ID: 29222768
The view is defined as one set of records in the database. This set of records is identified by the view name, so any change in the view definition must be propagated to all workareas where the view is open under different aliases. (You may open the database as a standard table - USE database.DBC NOUPDATE - and look at its records e.g. in BROWSE.)

It is even possible the database record belonging to the view is locked and then you cannot save changes made in the view definition.

The work around is to define new differently named view as you stated above (which is correct) or you may define the view without parameters and after its opening set filter to appropriate expression.

Author Closing Comment

ID: 31708444
always good to have your own guesses confirmed!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
In-App Messaging has revolutionized the way we look at marketing. It has also changed the way we use Apps. If In-App Messaging is used well then you will find that it can drive a lot of traffic to specific areas of your site. It also helps to improv…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question