Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alias not found - local view - have in Data Environment though 3

Status
Not open for further replies.

ahaws

Programmer
Nov 28, 2001
355
US
Hi -
I use a local view on a form. I requery('vpeoplemast') and data shows on the form in textboxes with controlsource set to vpeoplemast.field.
If there is more than one record in the view, I want a navbutton to become visible and I want to skip through the view just as a table.
Problem is, whe I execute code below for "Next" - it tells me the alias is not found. I dont close any thing before clicking this nav button- so I am not sure as to why I am getting this error. Please see below:

** "Next" Procedure in Navbutton
If !Used('VPEOPLEMAST')
lcCASEnum = Thisform.cASENUM
Requery('vpeoplemast')
thisform.Refresh()
Else [red]&& I found that the view was not in use at this point[/red]
Select VPEOPLEMAST
Endif
If !Eof()
Skip
else
Messagebox("No additional DEBTORS for this Account",64)
Skip -1
Thisform.Refresh()
Endif

any suggestions?
Thanks
Angie
 
Angie,


The only thing that comes to my mind is that the view is actually opened again. You have probably seen that before, when the first time it is opened as its proper name, and the subsequent times it is opened with 1, 2, etc. after it.

The view MyVIEW may be opened once as:

MyVIEW

and another time as:

MyView1

It looks like you are using a requery() rather than reopening the view so that should not occur, but it is the only thing I can think of at this time.



Jim Osieczonek
Delta Business Group, LLC
 
Angie,

In the code you posted, you try to requery the view if it's not used, but it can't be requeried if it's not used. A view must be opened in order to be requeried.

You need to pin down at what point the view is getting closed. One mistake I've made a lot is to forget to add an IN 0 at the end of a USE statement to open a new alias. Instead the new alias is opened in the current work area, and what was there is closed.


-BP (Barbara Peisch)
 
Hello-
>>In the code you posted, you try to requery the view if it's not used, but it can't be requeried if it's not used. A view must be opened in order to be requeried.


I have used views before, and what I generally do is include it in the dataenvironment(DE) - Then the form 'sees' the view. If I do not include it in the DE, it will throw an error that the alias is not found.
So- I never really have 'opened' views by selecting 0 and using the view.
I have done this many times, but this is the first time i get the error that the alias is not found when it resides in the DE of the form.
 
Open the form and look at the data environment to see what the name of the view is.

If the view was already open, when you added it to the data environment, it may have added it with the 1, 2, that I mentioned before at the end of the name.

Also, take a look at the controlsource on the controls.

I am thinking it is something goofy like that.



Jim Osieczonek
Delta Business Group, LLC
 
Hi


** "Next" Procedure in Navbutton
If !Used('VPEOPLEMAST')
lcCASEnum = Thisform.cASENUM
USE myDBC!VPEOPLEMAST IN 0 ALIAS vPeopleMast
Requery('vpeoplemast')
thisform.Refresh()
Else && I found that the view was not in use at this point
Select VPEOPLEMAST
Endif
..
..
..
..
Suitably change myDBC
:)

____________________________________________
ramani - (Subramanian.G) :)
 
I have used views before, and what I generally do is include it in the dataenvironment(DE) - Then the form 'sees' the view. If I do not include it in the DE, it will throw an error that the alias is not found.

My point was that in the code you posted, you already know that the view isn't used when you're trying to requery, and that won't work. Whether or not it was originally opened by the DE is beside the point. As Jim suggested, confirm that you're not opening the view under a different alias. If you're not, then the view is getting closed somewhere, and you need to figure out where.


-BP (Barbara Peisch)
 
Thanks to you all-
Ramani - I do not get the alias not found anymore - thanks

Have a great weekend.
Angie

 
Jimoo-
Still playing around with it...it is no longer telling me that the alias is not found, although when I requery the view as defined by Ramani- no records are found. This is strange.
I'll post if I figure it out.
Thanks for following up.....
angie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top