Addressing Form2 from Form1 lazarus / 21-General ---------------------------------------------------------------------- OC DelGuy · 2023-01-22 12:09 How can I address Form2 from Form1? I get an "Identifier not found 'Form2' " error when I try to run this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);  begin    Form1.Visible:=FALSE;    Form2.Visible:=TRUE;  end;  I tried to include Form2 in the Uses section of Form1, but that caused a "Fatal: Cannot find Form2 used by unit1 of the Project Inspector." I'm trying to switch forms during runtime.  Form1 has all my controls placed to see the contents of the database I created.  Form2, I created to add or remove individual records from the database. Ideally, I press a button on Form1 and Form2 appears.  I fill out the information on Form2 and press a button there to add a record to the database and return to Form1 where I display the entire database including all the information just entered. Thanks for the help y'all! ---------------------------------------------------------------------- howardpc · 2023-01-22 12:53 Quote from: OC DelGuy on January 22, 2023, 01:09:40 pmI tried to include Form2 in the Uses section of Form1, but that caused a "Fatal: Cannot find Form2 used by unit1 of the Project Inspector."This indicates that the IDE does not associate unit2 (if that is the name of Form2's unit) with your project. Check in the Project Inspector that both units are listed as part of your project, and if unit2 is missing, add it using the +Add button. ---------------------------------------------------------------------- OC DelGuy · 2023-01-22 14:45 Do you mean the "Object Inspector"? Or is there another one called "Project Inspector"? How do I get to the "Project Inspector"? ---------------------------------------------------------------------- howardpc · 2023-01-22 15:01 From the main menu Project The Project Inspector... menu item has an ellipsis which indicates that it opens another window, the Project Inspector. It is invaluable for managing all but the very simplest projects. ---------------------------------------------------------------------- tetrastes · 2023-01-22 19:26 Quote from: OC DelGuy on January 22, 2023, 01:09:40 pmI tried to include Form2 in the Uses section of Form1, but that caused a "Fatal: Cannot find Form2 used by unit1 of the Project Inspector." Try uses Unit2 ---------------------------------------------------------------------- jamie · 2023-01-22 20:23 or, Applicaton.FindComponent('The Form's Name').Show; something like that. ---------------------------------------------------------------------- OC DelGuy · 2023-01-22 20:54 Got it.  I see the Project Inspector.  Both units show up.  But I think it's because I put the unit name (instead of the form name) in the Uses section.  But I'll keep the Project inspector in mind in case I need to add a third form (unit) to the program. Thanks Y'all! ---------------------------------------------------------------------- howardpc · 2023-01-22 21:03 Quote from: OC DelGuy on January 22, 2023, 09:54:24 pm I think it's because I put the unit name (instead of the form name) in the Uses section. No, as tetrastes wrote, you need the unit name, not the form name in the uses clause. The uses clause specifies the units (based on disk files) that the unit-with-the-uses-clause depends on. ---------------------------------------------------------------------- OC DelGuy · 2023-01-22 23:23 Yep, Howard.  I put the Unit name in the Uses Clause.  Thanks to everyone who helped me.