>I have a need to create a table based on an existing table.
>
>The new table name will be entered into a textbox by the user.
>
>A Copy Structure(VFP) or Create table(SQL) example is what I require.
The piece you are probably missing is the "name expression": put the variable within parentheses, as in the last line of the following sample:
local lcTable
lcTable = alltrim(ThisForm.TxtTable.Value)
use MyTable
copy structure to (lcTable)
An alternative is "macro substitution":
...
copy structure to &lcTable
but this is slower in most cases.
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)