>I tried the alias as follows but I keep getting file does not exist. What I have is two forms (form1 and form2). Form1 passes a parameter to form2 which contains the view name. The views are also parametized. so I do the following:
>
>
do form2 with hldid, lcdate, 'lv_offopt6'
>
>
>when I go to form2 I have the following in the init:
>
>
parameter p1, p2
>USE (p2) ALIAS tbl_view ORDER op_uniqueid
> lcdate = (p1)
> REQUERY(tbl_view)
> seekval = INT(hldid)
> SEEK(seekval)
> .refresh()
I am not sure whether this is related to your problem, but:
The usual place to open a table is in the .Load() event, not in the .Init() event. The reason is that controls on the form are INITialized
before the Form.Init(), but
after the Form.Load().
The problem in this case is the parameter, which is accepted in .Init(). .Load() can't accept a parameter directly.
You can use a public, or a private (?) variable, from the calling form, to pass the information.
HTH, Hilmar.
>
>When I run the code, it thinks that p2 is a dbf file when it is actually a view that I am trying open. It gives me the following error
>
>
File 'e:\budget2002\lv_offopt6.dbf' does not exist
>
>I'm on the right track here, what is it that I am doing wrong? By the way I changed the controlsource for my textboxes to tbl_view.text1 etc... This should work right?
This should work, if you open the table/view in .Load(), and if neither the table nor the view is called tbl_view, but instead, is the alias of the table/view you open.
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)