IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

December Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyCorel Paradox / ObjectPAL Coding BoardObjectPAL Topic   Print This     

posting an undefined field

posting an undefined field in ObjectPAL topic (part of our Corel Paradox / ObjectPAL Coding group).

Quick Search: posting   undefined   posting undefined   posting undefined field  
boardBTCH
 (Inactive)
Ottawa, Ontario, Canada
Can anyone tell me how I can post multiple undefined check boxes to a field?
Example
there are 3 check boxes, named Boat, House and Cottage. If I check off any one of these fields, how can I post it to a field called "Description" in a table.Is it even possible without having to name each check box as a field in a table.
 Posted 20 years ago (Thread Starter)
Comment Quote
About boardBTCH -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1108, 14 replies
Thread Started 2/25/2001 1:24:00 PM
View Counter=3868
Last Reply Posted 3/31/2001 11:45:00 AM)
Location=Ottawa, Ontario, Canada  
Joined=21 years ago   MB Posts=19  
boardBTCH
 (Inactive)
Ottawa, Ontario, Canada
Al,
Thanks for replying. I am so close, I can smell it. You have no idea how long I have been trying to figure this out and you are the only one that has given me some light on this issue.
Anyway, I think I have it working somewhat, and the way it populates the Description column is almost what I'm looking for.
If I could have the table display something like this:
MEMBER_NO DESCRIPTION
1 Boat
1 House
2 Boat
3 House
3 Cottage

The way I see it posting in the description column with what you gave me is this:
MEMBER_NO DESCRIPTION
1 Boat, House
2 Boat
3 House, cottage

The reason I am looking to have it the other way, is because I will be joinin this table to a populated Member.db.
I only gave you an example of 3 check boxes, but in reality I have 35.
So, I can query something like this later:
SELECT Description
FROM Mem_Desc.db
WHERE Member_No = 1

Your help is greatly appreciated.
Thanks
Tracy
 Posted 20 years ago (Thread Starter)
Comment Quote
About boardBTCH -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1147 (Level 1.1)  Reply to 1108
Thread Started 2/27/2001 1:24:00 PM
View Counter=2
Location=Ottawa, Ontario, Canada  
Joined=21 years ago   MB Posts=19  
boardBTCH
 (Inactive)
Ottawa, Ontario, Canada
Al, thank you very much for your help. One other question, is there a way to have what I have checked off appear for each record if I went to that record after it has been posted?
So, if I went to record_no 10, I would like to see what check boxes I checked for that record.
Thanks
Tracy
 Posted 20 years ago (Thread Starter)
Comment Quote
About boardBTCH -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1280 (Level 1.2)  Reply to 1108
Reply Posted 3/8/2001 7:10:00 AM
Location=Ottawa, Ontario, Canada  
Joined=21 years ago   MB Posts=19  
boardBTCH
 (Inactive)
Ottawa, Ontario, Canada
Okay.....this is exactly what I want to do. I have multiple members who can have completed multiple tactics on a particular training date.
I have 3 tables.
TRAINING.DB
Training ID I *
Training Date
Duration From
Duration To
Total Hours
Instructor

MEMBER.DB
Member ID I *
Training ID I * (FK,SI)
Squad
Member Name

TACTICS.DB
Tactics ID I *
Training ID I * (FK,SI)
Description

On my form I have a tableframe attached to the Member.db.
I have designed the checkboxes the way it was mentioned in the posting, attaching code the way the posting mentions.
This is what is happening. When I enter the first record then post it, it is fine. When I insert another record, all the fields from Training.db and Member.db are cleared, but the checkboxes from the first record are still checked.
When I look directly in the table, the checkboxes are not being posted to the table. Where everything else is being posted to their table.
Any idea what I have done wrong?
 Posted 20 years ago (Thread Starter)
Comment Quote
About boardBTCH -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1471 (Level 1.3)  Reply to 1108
Reply Posted 3/21/2001 12:00:00 PM
Location=Ottawa, Ontario, Canada  
Joined=21 years ago   MB Posts=19  
boardBTCH
 (Inactive)
Ottawa, Ontario, Canada
Perfect......this is exactly what I have been looking to do. You're the best!!! There is no way that I could have figured it out this fast without your help. Or have figured it out at all. Paradox is very new to me.
There is one question though.....how did you get the lookup table on the Attendnce.db? There is nothing in the table restructure.And I didn't see anything in code.
 Posted 20 years ago (Thread Starter)
Comment Quote
About boardBTCH -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1534 (Level 1.4)  Reply to 1108
Reply Posted 3/27/2001 5:08:00 AM
Location=Ottawa, Ontario, Canada  
Joined=21 years ago   MB Posts=19  
boardBTCH
 (Inactive)
Ottawa, Ontario, Canada
Hi Al....I know about the Restructure dialog box, but when I look at the Table Lookup, there is nothing defined. So, that is why I was asking how you got the lookup table on Attndance.db
 Posted 20 years ago (Thread Starter)
Comment Quote
About boardBTCH -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1551 (Level 1.5)  Reply to 1108
Reply Posted 3/29/2001 4:42:00 AM
Location=Ottawa, Ontario, Canada  
Joined=21 years ago   MB Posts=19  
AIBreveleri
If you want to allow only one of the items -- four possible values -- in the field, then you should use a set of three radio buttons, in a field bound to the Description column.

By 'four possible values' I mean:
- blank
- 'Boat'
- 'House'
- 'Cottage'

If you want to allow any combination of items -- eight possible values -- in the field, then you should consider storing the data in three separate columns of type logical. This will make the data easier to search with QBE or SQL.

By 'eight possible values' I mean:
- blank
- 'Boat'
- 'House'
- 'Boat, House'
- 'Cottage'
- 'Boat, Cottage'
- 'House, Cottage'
- 'Boat, House, Cottage'

Another technique to allow any combination of items is to use a set of eight radio buttons labeled with all eight combinations.

If your post means exactly what it says, then you must add ObjectPal code to your form to synchronize the Description field of the active record to the three check boxes.

In my example, I attached a tableframe to the table containing the Description column. I didn't include a column in the tableframe for Description; instead I added a field object (unlabeled) into another column, bound it to the Description column, named it bfDescription, and made it invisible.

My checkbozes were named cbBoat, cbHouse, and cbCottage. Each one was defined to have the value 'true' when checked and 'false' when unchecked.

To make the checkboxes reflect the contents of the Description field of the current record, I added this code to the action event of the tableframe:

method action(var eventInfo ActionEvent)
if (eventInfo.id()=DataArriveRecord)
or(eventInfo.id()=DataPriorSet)
or(eventInfo.id()=DataPriorRecord)
or(eventInfo.id()=DataNextRecord)
or(eventInfo.id()=DataNextSet)
then
cbBoat.Value = (search(bfDescription.Value,"Boat")<>0)
cbHouse.Value = (search(bfDescription.Value,"House")<>0)
cbCottage.Value = (search(bfDescription.Value,"Cottage")<>0)
endif
endMethod

If you look closely at a checkbox, you will see that it contains a button. To make the contents of Description follow the state of the checkboxes, I added this code to the pushButton event of each checkbox's button:

method pushButton(var eventInfo Event)
var SS string endvar
dodefault
if isEdit() then
SS = iif(cbBoat.Value,"Boat","")
SS = SS+iif(cbHouse.Value,iif(size(SS)>0,", ","")+"House","")
SS = SS+iif(cbCottage.Value,iif(size(SS)>0,", ","")+"Cottage","")
bfDescription.Value = SS
endif
endMethod

You may need to adapt the technique to your particular circumstances.

-Al.


[This message has been edited by A. I. Breveleri (edited February 26, 2001).]
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1121 (Level 1.6)  Reply to 1108
Reply Posted 2/26/2001 1:59:00 PM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
Oh, 35 checkboxes, not 3. That is an entirely different architecture. With that many data items in any combination, only a normalized detail table makes sense. If you really want to represent the detail data as a list of checkboxes, this is possible with a little coding. The amount of code needed is not large, and the sophistication level of the code is barely beyond the beginner level.

Your form needs to accomplish two tasks with the checkboxes:
(1) when you arrive on a new master record, the detail data must be used to set the checkboxes, and (2) at some point you must copy any changed checkboxes into the detail data.

Here is the way I got it to work. The form is bound to the master table. The detail form does not appear in the form's data model. Instead, it is accessed through a tcursor, which is declared at the form level. The tcursor is made to behave like a detail table in a linked data model, by setting a range on the tcursor whenever the master record changes.

The checkboxes are all contained in a box (any non-data uio type would do). Processing all the checkboxes is accomplished with a uiobject type variable, using the First property of the container box and Next property of each checkbox in turn.

I decided to copy the changed checkbox value to the detail as soon as it is changed. This is the easiest event to trap, and avoids any perceptible delay when moving off a changed member.

Here is the recipe.

Use a form with a tableframe or MRO bound to "Member.db". I'm assuming it contains a field "MEMBER_NO" bound to that column.

Place a box on the form; call it "grpCheckBoxes". Put all the checkboxes in this box. (Note: add the code below before duplication.) Each checkbox must be designed like this:

- the field may have any name -- I named the first one "fldDesc1" and let Paradox name the duplicates, but my code does not reference the field name.

- the button must be named "btnCheck"

- the label on the button must be named "txtLabel"

- the checkbox must have the value "true" when checked and "false" when unchecked.

- the value of the label must match exactly the data item that the checkbox is intended to control.

Add this to the form's var method:
   tcDESC  tcursor

Add this to the form's open method (in the form's part):
   if not tcDESC.open( "Mem_Desc.db" ) then errorshow() formReturn(false) endif
tcDESC.edit()

Add this to the form's proc method:
proc CHANGECHECK( const as_Prop string, const al_Have logical )
if al_Have then ; adding desc
try
tcDESC.insertAfterRecord()
tcDESC."MEMBER_NO" = MEMBER_NO.Value
tcDESC."DESCRIPTION" = as_Prop
tcDESC.unlockRecord()
onfail
msgstop( "SOMEONE IS SIMULTANEOUSLY MODIFYING THIS SAME DATA",
"Cannot add description -- it already exists for this member." )
tcDESC.cancelEdit()
endtry
else ; deleting desc
if tcDESC.qlocate( MEMBER_NO.Value, as_Prop ) then
tcDESC.deleteRecord()
else
msgstop( "SOMEONE IS SIMULTANEOUSLY MODIFYING THIS SAME DATA",
"Cannot remove description -- it is already gone." )
endif
endif
endproc

Add this to the action method of the tableframe or MRO that contains the master records:
method action(var eventInfo ActionEvent)
var
OO uiobject
BoxName string
endvar
if (eventInfo.id()=DataArriveRecord)
or (eventInfo.id()=DataPriorSet)
or (eventInfo.id()=DataPriorRecord)
or (eventInfo.id()=DataNextRecord)
or (eventInfo.id()=DataNextSet)
then
tcDESC.setRange( MEMBER_NO.Value )
OO.attach(grpCheckBoxes)
BoxName = OO.First
while BoxName<>blank()
OO.attach(BoxName)
OO.Value = tcDESC.qlocate( MEMBER_NO.Value, OO.btnCheck.txtLabel.Value )
BoxName = OO.Next
endwhile
endif
endMethod

Add this to the pushButton method of the button in each checkbox:
method pushButton(var eventInfo Event)
dodefault
CHANGECHECK( string(self.txtLabel.Value), logical(container.Value) )
endMethod

With the checkboxes designed in this way, you can add a checkbox for a new description item by duplicating any existing checkbox and setting its label text. Just make sure the new checkbox is also inside the box "grpCheckBoxes".

If you want to use cosmetic objects to visually organize the checkboxes, you must set their ContainObjects property to false before running the form.

-Al.
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1169 (Level 1.7)  Reply to 1108
Reply Posted 2/28/2001 11:16:00 AM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
Sorry -- my mistake. With the recipe I gave, you cannot use cosmetic objects inside "grpCheckBoxes" to visually organize the checkboxes. The code requires that "grpCheckBoxes" contain nothing but the checkboxes.

If you need more visual freedom, make "grpCheckBoxes" a group instead of a box. However this adds a couple of steps to the process of adding another checkbox, should this ever become necessary. Paradox will not allow you to add an object to an existing group.

-Al.
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1175 (Level 1.8)  Reply to 1108
Reply Posted 2/28/2001 12:48:00 PM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
Sorry -- my another mistake. I just realized that setting a range on the tcursor is completely unnecessary. I put that in when I was still thinking that filling the checkboxes from the detail table would be done by scanning the linked detail records. But this is actually accomplished by examining all the checkboxes.

So delete from the third paragraph the sentence "The tcursor is made to behave like a detail table in a linked data model, by setting a range on the tcursor whenever the master record changes.", and delete from the action method the line "tcDESC.setRange( MEMBER_NO.Value )".

-Al.


[This message has been edited by A. I. Breveleri (edited February 28, 2001).]
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1183 (Level 1.9)  Reply to 1108
Reply Posted 2/28/2001 7:36:00 PM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
Already part of the recipe. This is the purpose of the code in "the action method of the tableframe or MRO that contains the master records".

The test in the 'if' statement makes the code run whenever arriving on a record. (The setRange() statement is, as I said, a mistake; take it out.) The 'while' loop steps through all the checkboxes. The body of the 'while' loop looks in the table for the current member and the present checkbox -- sets the checkbos 'true' iff found. The code is deliberately very terse to increase speed.

-Al.
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1284 (Level 1.10)  Reply to 1108
Reply Posted 3/8/2001 10:32:00 AM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
OK I think I understand. You want to record that on a certain day during certain hours, a training course was given. Certain members attended, and certain tactics were taught. All members present were trained in all tactics presented. Do I have it right?

-Al.


[This message has been edited by A. I. Breveleri (edited March 22, 2001).]
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1488 (Level 1.11)  Reply to 1108
Reply Posted 3/22/2001 8:28:00 AM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
You are dealing with three entity lists: Members, Training Sessions, and Tactics. Your training log will link Members with Training Sessions, and Tactics with Training Sessions.

The Members are stored in a straightforward way:

MEMBER.DB
Member_ID I *
Squad
MemberName
etc.

You don't need 'Training_ID I * (FK,SI)' in this table.

BTW you might want to consider adding a column to indicate the active status of a member, so you can keep members in this table after they leave the platoon.

The Training Sessions are stored in a straightforward way:

TRAINING.DB
Training_ID I *
TrainingDate
DurationFrom
DurationTo
TotalHours
etc.

Anything recorded in this table refers to a Training Session, all the Members attending, and all the Tactics presented.

Because a Member may attend more than one Training Session, and each Session may be attended by more than one Member, you cannot simply link the Sessions to the Members or the Members to the Sessions. You will need a separate table -- the 'linking table' -- to record each instance of a Member attending a Session. Create a new table something like this:

ATTNDNCE.DB
Training_ID I *
Member_ID I *

In the data model of the training log form:

TRAINING.DB -->> ATTNDNCE.DB --> MEMBER.DB
            [Training_ID]    [Member_ID]

Your form should have a tableframe for entering attendance. Define its columns as 'ATTNDNCE.Member_ID', 'MEMBER.Squad', 'MEMBER.MemberName', etc. You will probably want to define a lookup (all corresponding fields + help and fill) from 'ATTNDNCE.Member_ID' to MEMBER.Member_ID'.

Similarly, a Session may teach more than one Tactic, and a Tactic may be presented at many Sessions. So you can't link Sessions to Tactics or Tactics to Sessions. You will need another linking table. You already have it:

TACTICS.DB
Training_ID I *
Description A50 *

You don't need 'Training_ID I * (FK,SI)' in this table.

The interesting thing about TACTICS.DB is that it does not link two tables together. The list of Tactics is not stored in any table -- it is stored as a set of checkboxes on the TrainingLog form. TACTICS.DB actually links a table with a list of checkboxes.

This demonstrates that a linking table does not link two tables together. It links two lists together.

This is the table that the code in my previous post is designed for.

Make sure that when you add a new record to TRAINING.DB, you insert its integer key before you display or change the checkboxes. The best way to do this is to add 'action(DataPostRecord)' immediately after writing the new key to the new record. The code that I gave for 'the action method of the tableframe or MRO that contains the master records' contains a 'qlocate()' that must use this new key value.

-Al.


[This message has been edited by A. I. Breveleri (edited March 27, 2001).]
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1497 (Level 1.12)  Reply to 1108
Reply Posted 3/22/2001 12:38:00 PM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
AIBreveleri
In the upper-right of the Restructure dialog box is a dropdown-list field offering these choices:

Validity Checks
Table Lookup
Secondary Indexes
Referential Integrity
Password Security
Table language
Dependent Tables

Identification of the correct choice to allow management of lookup table links is left as an exercise to the reader.

-Al.
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1535 (Level 1.13)  Reply to 1108
Reply Posted 3/27/2001 12:05:00 PM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  
Most Recent Post
AIBreveleri
Select the field in the left pane first. Some structure operations are set for the entire table, while others are set for each field.

-Al.
 Posted 20 years ago
Comment Quote
About AIBreveleri -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #1592 (Level 1.14)  Reply to 1108
Reply Posted 3/31/2001 11:45:00 AM
Location= 
Joined=20 years ago   MB Posts=286   KB Comments=8  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P195A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #1108 Counter
3868
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]