Beginner Paradox Question Re : TableFrames/UIObjects/TCursors 
Author Message
 Beginner Paradox Question Re : TableFrames/UIObjects/TCursors

Greetings all!

I'm a student picking up PDox 8 as part of both a computer science course,
and am intending to explore it more on my own.

My question is quite simple, but it might be difficult to answer w/o seeing
the form...and this problem has been frusturating me to no end over the
last few days.

I am creating a form that will create a database, and allow basic record
manipulation functions, i.e Search, Add, Delete et al...

My problem at this point is in the very early stages...all of my code
compiles, however I get a Pdox Runtime Error when I run the form, saying
that (the name of the database that the user wants to create, stored as a
string) could not be accessed from the button to which the code is
attached.  The error says that the object could not be found or is not
visible ... however, the Table IS being created (I tested this by putting
msgInfo's in the pushButton method)  and the method is completing itself...

Here is my code :

in Form's Var list :

DataModel Table
TablePointer UIObject

method pushButton(var eventInfo Event)
{Create a new data model}

{get name of new table}
TableName.view("Enter the filename for the new Table")
try
        DataModel = Create TableName  WITH
                                "Last Name":  "A20",
                                "First Name" : "A20",
                                "Address"     : "A30",
                                "BirthDate" : "D",        
                                "Income"              : "$",
                                "Number Of Courses" : "A2"
                                endCreate

        TablePointer.attach(TableName)  
        DatabaseFunctionsBox.visible = TRUE
        DatabaseFunctionsBox.enabled = TRUE

onFail
        msgStop("Error", "You must enter a filename")
endTry
end method

I've tried changing to a TCursor, but when i change that the AddRecord
method fails to work (it's just basically a action(DataInsertRecord))...

This could just be some syntax that I haven't grasped as of yet, or
something quite simplistic...but any help that you could give me would be
greatly appreciated!

Thanks in advance,

Kurt Penner



Mon, 25 Sep 2000 03:00:00 GMT
 Beginner Paradox Question Re : TableFrames/UIObjects/TCursors

Kurt Penner skrev:

Quote:
> Greetings all!

> I'm a student picking up PDox 8 as part of both a computer science course,
> and am intending to explore it more on my own.

> My question is quite simple, but it might be difficult to answer w/o seeing
> the form...and this problem has been frusturating me to no end over the
> last few days.

> I am creating a form that will create a database, and allow basic record
> manipulation functions, i.e Search, Add, Delete et al...

> My problem at this point is in the very early stages...all of my code
> compiles, however I get a Pdox Runtime Error when I run the form, saying
> that (the name of the database that the user wants to create, stored as a
> string) could not be accessed from the button to which the code is
> attached.

The TableFrame on the form has to associated with the, new, underlying physical
table

- Show quoted text -

Quote:
> The error says that the object could not be found or is not
> visible ... however, the Table IS being created (I tested this by putting
> msgInfo's in the pushButton method)  and the method is completing itself...

> Here is my code :

> in Form's Var list :

> DataModel Table
> TablePointer UIObject

> method pushButton(var eventInfo Event)
> {Create a new data model}

> {get name of new table}
> TableName.view("Enter the filename for the new Table")
> try
>         DataModel = Create TableName  WITH
>                                 "Last Name":  "A20",
>                                 "First Name" : "A20",
>                                 "Address"       : "A30",
>                                 "BirthDate" : "D",
>                                 "Income"                : "$",
>                                 "Number Of Courses" : "A2"
>                                 endCreate

>         TablePointer.attach(TableName)

You try to attach an object named  TableName  on your form, does such an object
exist?

- Show quoted text -

Quote:
>         DatabaseFunctionsBox.visible = TRUE
>         DatabaseFunctionsBox.enabled = TRUE

> onFail
>         msgStop("Error", "You must enter a filename")
> endTry
> end method

> I've tried changing to a TCursor, but when i change that the AddRecord
> method fails to work (it's just basically a action(DataInsertRecord))...

> This could just be some syntax that I haven't grasped as of yet, or
> something quite simplistic...but any help that you could give me would be
> greatly appreciated!

> Thanks in advance,

> Kurt Penner

You can open the table with a quickForm (MenuQuickForm) OR in a table window
like this

;pushBotton
var
    tv     TableView
endVar

if not tv.open("TableName") then
    errorShow()
    return
endIf

tv.setTitle("EnterATitle")
tv.action(DataBeginEdit) ;enter edit mode

tv.wait() ;wait for user to close tableView

try
    tv.close()
onFail
    errorClear()
endTry

endMethod

--
Michael

Remove NOSPAM to reply



Tue, 26 Sep 2000 03:00:00 GMT
 Beginner Paradox Question Re : TableFrames/UIObjects/TCursors

Another suggestion could be using two forms, one that creates the table and
another that displays the newly created table. You will have to create the
firste table yourself  then create the display form this table. Then open the
display form using  FormOpenInfo  and change the name of the masterTable

e.g. code on a button

Var
    foi             FormOpenInfo
    formVar     Form
endVar

;First remember to declare the TableName variable as a String in the Forms Var
list

If (TableName.isAssigned = FALSE) then
    msgStop("Missing value","You have not created a table")
    return
endIf

foi.name "NameOfDisplayForm"
foi.masterTable = "TableName"

if not formVar.open(foi) then
    errorShow()
    return
endIf

formVar.DesignModified = FALSE
formVar.action(DataBeginEdit)

endMethod

Kurt Penner skrev:

Quote:
> Greetings all!

> I'm a student picking up PDox 8 as part of both a computer science course,
> and am intending to explore it more on my own.

> My question is quite simple, but it might be difficult to answer w/o seeing
> the form...and this problem has been frusturating me to no end over the
> last few days.

> I am creating a form that will create a database, and allow basic record
> manipulation functions, i.e Search, Add, Delete et al...

> My problem at this point is in the very early stages...all of my code
> compiles, however I get a Pdox Runtime Error when I run the form, saying
> that (the name of the database that the user wants to create, stored as a
> string) could not be accessed from the button to which the code is
> attached.  The error says that the object could not be found or is not
> visible ... however, the Table IS being created (I tested this by putting
> msgInfo's in the pushButton method)  and the method is completing itself...

> Here is my code :

> in Form's Var list :

> DataModel Table
> TablePointer UIObject

> method pushButton(var eventInfo Event)
> {Create a new data model}

> {get name of new table}
> TableName.view("Enter the filename for the new Table")
> try
>         DataModel = Create TableName  WITH
>                                 "Last Name":  "A20",
>                                 "First Name" : "A20",
>                                 "Address"       : "A30",
>                                 "BirthDate" : "D",
>                                 "Income"                : "$",
>                                 "Number Of Courses" : "A2"
>                                 endCreate

>         TablePointer.attach(TableName)
>         DatabaseFunctionsBox.visible = TRUE
>         DatabaseFunctionsBox.enabled = TRUE

> onFail
>         msgStop("Error", "You must enter a filename")
> endTry
> end method

> I've tried changing to a TCursor, but when i change that the AddRecord
> method fails to work (it's just basically a action(DataInsertRecord))...

> This could just be some syntax that I haven't grasped as of yet, or
> something quite simplistic...but any help that you could give me would be
> greatly appreciated!

> Thanks in advance,

> Kurt Penner

--
Michael

Remove NOSPAM to reply



Tue, 26 Sep 2000 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. PDOXWIN TableFrame, UIObject Question

2. record locking on Tcursors attached to UIObjects

3. Help! TCursor and UIObject

4. Help! TCursor and UIObject

5. Sync TCursor to UIobject

6. TCursors and UIObjects

7. 3 Questions Re: Memo Type UIObjects in Forms - Paradox 5.0

8. TableFrame and Tcursor ??

9. Previous post about tableFrames (vs. TCursors)

10. Tryinng to insert record in tableframe with Tcursor

11. P4W(OPAL), Queries->TCursors->TableFrame

12. how do I get a Tableframe's fields, with TCursor to look like a table bound tableframe


 
Powered by phpBB® Forum Software