Switching between forms

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Brian C (anonymous_at_discussions.microsoft.com)
Date: 04/28/04


Date: Wed, 28 Apr 2004 03:01:57 -0700

I have form1 based upon table1 and form2 based upon table2.

I want to use data input in form1 to get a record from
table1 and if a certain value exits go to form2. Data is
then input in form2 and used to create a record in table2.
I then want to go update the read from table1 with some of
the data from the table2 record.

How do I achieve this?

Do I have to keep form1 open switch to form2 and then
switch back to form 1?

How do I ensure that the original form1 is activated and
not a new form1 so that the record is available?

How do I make the data from form2 available in form1 to
update the record?

I assume that I would have to do this using code so in
what events for each form would I piut the code?

How do I switch between forms using Access Basic code?

By the way could I somehow make the record selected from
table1 in form1 available in form2 so that I don't have to
keep form1 open and switch back?

Thanks for your help.



Relevant Pages

  • Re: How to pass information, classes between forms in Windows Application mode
    ... purposes it's the same as the parameterized copy constructor, ... Another way is the inheritance of forms, Form2: ... Form1 as you discuss below and as I further comment below. ... Form2 from Form1 is not passing the true object but a copy of the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Still confused about passing data between forms (or classes)
    ... public partial class Form1: Form ... public Form2 form2; ... private void button1_Click(object sender, EventArgs e) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: beginner programmer with a problem.
    ... My problem now is that if I click on the command button on Form1, ... ever get Form2 opened to the same initial record. ... > This sets the field or control named RecordID on Form2 to the same value as ... > the field/control named RecordID on Form1. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to get info from another form...
    ... Private Sub New ... Public Class Form2 ... Private _Instance As Form2 ... Let's say you begin in Form1 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Inserting Record from Multiple Tables
    ... As long as both form1 and form2 are still open, you can use SQL to do the insert, making sure your references to the form1 files are fully qualified, thus: ... put this code to append to table3 in the on click event for a "Close" command button on form2, then use docmd.close to close the form. ... would also like it to add a record to a table3, using a combination of fields from table1 and table2. ...
    (microsoft.public.access.formscoding)