One Table 2 forms

  • Thread starter Thread starter Brook
  • Start date Start date
B

Brook

Hi All,

I am using two forms for one table. One form uses a
limited info tabular form and the second uses the details
bases on the first form. On the first form I have a drop
down box that the user choses the Company which in turns
populates a Company ID on the first form, and Comp.
Contact, Contact Phone, and Contact Email on the Second
form. On the first form, I also have a Vendor Name in
which the user manually types in. From here I use a button
to open the Form II that opens the record based on the
primary key. What I would like to do is when formII opens,
the data is populated/updated/refreshed. this is where I
am unsure on what to do?

Any Suggestions are welcome..

Brook
 
Brook

I am unclear why you need two forms to display one table's rows. An unbound
combo box to select the company could, in its AfterUpdate event, filter the
form to display just that one row.

And you may want to create a Vendor table so you don't end up with (as many)
typos in the spelling of the vendors' names (i.e., are the following the
same company?):

Microsoft
Microsfot
Microsoft Corp.
MS
 
The reason I am using two forms is that one Form only
contains a limited amount of infomation about the record.
Company Name, Company ID, and Employee Name. The reason it
is set up like this is so that all the information about
the record isn't display and cluttering the screen. So
then the user can Click a details button and go to the
details about the record. My problem is, is that the
details button doesn't update the record therefore the
data from the first form doesn't show up on the second.

Brook
 
Brook

Consider another approach. You could "hide" the detail fields in a single
form (?one way would be to use the .Visible property) until after that same
<Details> button is clicked, but still have them already loaded and
available. And this would get around managing and navigating and updating
between two forms.
 
The reason I am using two forms is that one Form only
contains a limited amount of infomation about the record.
Company Name, Company ID, and Employee Name. The reason it
is set up like this is so that all the information about
the record isn't display and cluttering the screen.

In addition to Jeff's suggestion, consider the possibility of using a
Tab Control on the form. Put the basic information on the first page
of the tab, and the details on the second - then the user needs to
simply click on the "Details" tab to see the additional data.

To get the first form's data to show up on the second form, you'll
need to explicitly save the record to disk before opening the second
form. Put a line

If Me.Dirty = True Then Me.Dirty = False

in the VBA code which opens the second form; this will force a save.
 
Back
Top