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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using aliases in a grid

Status
Not open for further replies.

GlenGodbold

Programmer
Mar 5, 2001
14
GB
The problem: users have main database for updating. Occasionally they need to select one or two records to extract data into Word. I want to give them a grid with a checkbox and the 'name' of the record so they can select the records they want. As more than one user might be selecting records at the same time, I'm creating a separate mini table for each user which just contains the logical field and the name field by using sys(3) to create a name and copying the relevant data into it, then using it with

mnewtable=sys(3)
copy fields check, name to &mnewtable
use &mnewtable alias newalias

I can't figure out how to populate a grid with the new table; neither newalias or even &newalias works as a record source. I know I'm missing something really obvious, but can anyone help

Thanks
 
Hi
1. If you are only reading a table and extracting data but not updating, you can always use the table directly. Just set exclusive off, which in any case you have to do. There is no need to create separate tables using SYS(3).
2. You can always create a view with required fields and the view can be used by you.
Hope this helps
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
To directly answer your question, put this in:
Code:
mnewtable=sys(3)
copy fields check, name to &mnewtable
use &mnewtable in 0
thisform.grid1.recordsource=mnewtable
My preferred way of doing it is to use a SELECT statement to pull the records. This creates a temporary table in memory that doesn't take up space on the drive:
Code:
mnewtable=sys(3)
select check,name from oldtable where name=m.thisone into cursor (mnewtable)
thisform.grid1.recordsource=mnewtable
The clause "where name=m.thisone" is simply the criteria you use to choose which record(s) the user needs access to. Leave that part out if you want ALL records in the table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top