Update a form from a form

wroyce

New Member
Joined
Mar 28, 2004
Messages
26
I have two tables, a query that joins the two tables and two forms.

The Table 1 has an auto-number field called "Record." Table 2 has a number field called "Record" (these two fields are my join).

On Form 1 I have the auto-number field "Record" and on Form 2 I have the number field "Record." I use a command button to call Form 2 from Form 1. I would like to type my information in Form 1 (the auto-number field would automatically update) and when I click the command button to call Form 2, I would like the matching field "Record" to automatically be updated with same number as the auto-number field from Form 1.

Can this be done?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Yes this can be done but before we do this, have you considered using a subform? A subform is a form embedded inside another form and it sounds like it would be perfect for what you want to do. When you create a record in the main part of the form (updating table 1) then when you go into the subform, it picks up the record ID from the main part of the form and stores the record ID's in the second table automatically and you get to see the main records and subform records all on the same screen. Is this an option instead of using 2 different forms?

Andrew
 

wroyce

New Member
Joined
Mar 28, 2004
Messages
26
I wanted to use a pop up form because 1)the information contained in this form won't always be filled in 2)Form 1 is a bit long and I didn't want to lengthen it by adding to it (I'm trying to keep it all on the screen) 3)I want the user to have to make a choice to use this form.
 

pfarmer

Well-known Member
Joined
Jul 6, 2005
Messages
550
I wanted to use a pop up form because 1)the information contained in this form won't always be filled in 2)Form 1 is a bit long and I didn't want to lengthen it by adding to it (I'm trying to keep it all on the screen) 3)I want the user to have to make a choice to use this form.

Just to make sure you understand that the subform can be in the form of a tab off of the main form, doesn't really add much in the way of size, etc.

If you want to use two forms, what type of control is the 'record' you want to copy from and what type of control are you copying to?

Perry
 

wroyce

New Member
Joined
Mar 28, 2004
Messages
26
I'm not sure what is meant by type of control.

In Form 1 the field "Record" is a auto-number long integer.
In Form 2 the field "Record" is a number long integer.
 

pfarmer

Well-known Member
Joined
Jul 6, 2005
Messages
550
I'm not sure what is meant by type of control.

In Form 1 the field "Record" is a auto-number long integer.
In Form 2 the field "Record" is a number long integer.

What I am talking about is the type of control that displays the record in the first userform (such as a listbox, combobox, textbox, etc.) as well as the target control in the second userform.

Perry
 

Forum statistics

Threads
1,136,621
Messages
5,676,852
Members
419,656
Latest member
lironprofit

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top