1

(1 replies, posted in General)

This is for a simple debit/credit entry but I'm not sure it can be done.

I either need to write two entries to the same table on the same form where each entry properly links to a parent account table. I don't think this is possible because there's no way to tie specific fields to specific parent tables.

OR

I need to write two entries to two different tables using the same form.  I don't think this is even possible because the SAVE RECORD option requires you to select ONE table to write to.

Can either one of these be done?

DriveSoft wrote:

Hello,


In current version you can't get result from SQL query  to TableGrid by script.

I suggest you use button with action "SQL query" with SQL:

SELECT number FROM Scene WHERE Scene.id = {cbScene};

Inside the Closeup event for cbScene you can click on this button by script for execute query:

Form1.ButtonSQL.Click;

Fair enough.  I also discovered that you can select a parent record from a grid, which gives me the flexibility I need for what I was trying to do.

cbScene is a combobox which is linked to foreign key SceneCharacter.id_Scene, which points to Scene.id
txtNumber is an edit box

Here is my script: (inside the Closeup event for cbScene)

tablegrid1 := SELECT number FROM Scene WHERE Scene.ID = '{cbScene}';

When I run the program, I get the error: ';' exptect at 7:21. 

This query works fine if it is placed as the action for a command button.

Just spent several hours building a tab control and needed to delete one of the pages.  Selected delete, the whole control went away and there's no way to get it back.

This is a situation where a confirmation message (Do you want to delete [control.name]) would have saved the day.  The context menu should also indicate what is being deleted.  (Delete Tab/Delete Control)

5

(2 replies, posted in General)

I actually got this to work by using forms and grids in a specific way.  It actually works quite well as long as you follow a certain procedure.  I'll get back to you with details later.  (It's been a very long day and I'm just too tired to explain, but I wanted to let you know I found a solution.)

6

(2 replies, posted in General)

I tried to set up a junction table test and the data grid does not appear to be handling it well. 

First, I created a table called Students.
Then, I created a table called Classes.
Next, I created a junction table wtih a relationship to Students and a relationship to Classes.  There are no other fields in the junction table.

I created one student record and three class records.

On my student form, I have an AddClass button that brings up a form to add the student to a class (that is, to create a record in the junction table)
This form has a dropdownbox tied to the foreignkey corresponding to classes.  (JunctionTable.id_Classes)  When I click the dropdown box, I get a nice list of classes. 

I have an OK button which saves the record to the junction table.  The only field I am writing is the combobox value, which is the class id.  Honestly, I don't know where it can get the student ID, but it is being written succesfully.  When I create a grid for the junction table, it shows records with the correct student id and class id.

My problem is getting a grid on the student form to list the classes that student has enrolled.  If I choose JunctionTable.id_Classes, the grid lists the classes, but it lists all of them, not just the ones for the student.  If I choose JunctionTable.id_Students and then try to select records from the class table, I get an error.

How do I get this to work?