Page 1 of 1

SwitchBoard with Filter and Button + More actions

Posted: Mon Dec 03, 2018 6:38 pm
by DreamerArgentino
Hi all!
I have this base: (see attached): and I would need that: the data I choose in the Switchboard is "injected" in the field "ID- Dept "of the table" TBL-Students "when choosing initially, and simultaneously create a new record in the form" FRM-Students01 "

I hope you can help me! Thank you
DreamerArgentino.-

Re: SwitchBoard with Filter and Button + More actions

Posted: Wed Dec 05, 2018 6:39 am
by UnklDonald418
To open the form document FRM-Students01 ready to enter a new record, open the Form Properties dialog for "MainForm" and on the Data tab change the Add data only property to Yes.

The form document Initial-Switchboard01 makes things needlessly complicated.
Since the selected value for field "ID- Dept" is ultimately stored in TBL-Students why not just use a list box on "MainForm" of FRM-Students01 to select a Department.
If you want to force the user to select a Department when entering a new Student record, an easy solution would be to add a NOT NULL constraint to the column "ID- Dept"

To do that you will first need to either edit all the existing student records and add a value in the "ID-Dept" column, or delete those records. Then execute the following SQL command

Code: Select all

ALTER TABLE "TBL-Students" ALTER COLUMN "ID-Dept" SET NOT NULL;
Then if the user attempts to enter a new student record without selecting a Department they will get an error dialog.