If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Programatically Enter Data Into Another Form
My data has 10 accounts.
Two forms are opened simultaneously. Form1 is unbound and displays three records: Account Quantity 101 17 104 25 107 13 Form2 is a bound continuous form displaying records for all 10 accounts. The records in Form2 include the Account#. How can I programatically enter 17, 25, and 13 from Form1 to the Quantity field in the records in Form2 where the Account#s are 101, 104 and 107 respectively? The intent is to enter what's in Form1 into Form2, view the data from Form1 along side other data in Form2 and when Form2 is closed, save the data. Appreciate all help! John |
#2
|
|||
|
|||
Programatically Enter Data Into Another Form
John,
I hope this is a "tip" which will help... Forms do not have data, and it often contributes to confusion if you think of data being in forms. It usually helps me to realise that the data is stored in tables, while the forms serve the purpose of providing an avenue for viewing and interacting with the data. Now as regards your question, I am a bit confused. If Form1 is unbound, I don't know of any way to "display three records". Unless you mean there are 6 unbound textboxes, all on the detail section of the form... is this what you've got? If so, will there always be 6 textboxes to represent 3 pairs of values, or will there sometimes be more or less? I feel the simplest approach would be to base Form1 on a table, and then use an Update Query to "transfer" the values entered to the main table as represented by Form2. -- Steve Schapel, Microsoft Access MVP John wrote: My data has 10 accounts. Two forms are opened simultaneously. Form1 is unbound and displays three records: Account Quantity 101 17 104 25 107 13 Form2 is a bound continuous form displaying records for all 10 accounts. The records in Form2 include the Account#. How can I programatically enter 17, 25, and 13 from Form1 to the Quantity field in the records in Form2 where the Account#s are 101, 104 and 107 respectively? The intent is to enter what's in Form1 into Form2, view the data from Form1 along side other data in Form2 and when Form2 is closed, save the data. Appreciate all help! John |
#3
|
|||
|
|||
Programatically Enter Data Into Another Form
Steve,
Thanks for the response and the tip. Yes, there will there always be 6 textboxes all on the detail section of the form and they represent 3 pairs of values. One or more pairs may be blank. John "Steve Schapel" wrote in message ... John, I hope this is a "tip" which will help... Forms do not have data, and it often contributes to confusion if you think of data being in forms. It usually helps me to realise that the data is stored in tables, while the forms serve the purpose of providing an avenue for viewing and interacting with the data. Now as regards your question, I am a bit confused. If Form1 is unbound, I don't know of any way to "display three records". Unless you mean there are 6 unbound textboxes, all on the detail section of the form... is this what you've got? If so, will there always be 6 textboxes to represent 3 pairs of values, or will there sometimes be more or less? I feel the simplest approach would be to base Form1 on a table, and then use an Update Query to "transfer" the values entered to the main table as represented by Form2. -- Steve Schapel, Microsoft Access MVP John wrote: My data has 10 accounts. Two forms are opened simultaneously. Form1 is unbound and displays three records: Account Quantity 101 17 104 25 107 13 Form2 is a bound continuous form displaying records for all 10 accounts. The records in Form2 include the Account#. How can I programatically enter 17, 25, and 13 from Form1 to the Quantity field in the records in Form2 where the Account#s are 101, 104 and 107 respectively? The intent is to enter what's in Form1 into Form2, view the data from Form1 along side other data in Form2 and when Form2 is closed, save the data. Appreciate all help! John |
#4
|
|||
|
|||
Programatically Enter Data Into Another Form
John,
As mentioned before, I would recommend making a table to temporarily hold the values you want to put into your main table, and bind your Form1 to this table. Then it is a simple Update Query to do what you want. However, there would be a few approaches to using your existing setup. For example, use a VBA procedure to run 3 update queries, one for each potential pair of values, something like this... If IsNull(Me.Textbox1 + Me.Textbox2) Then ' move on Else CurrentDB.Execute "UPDATE MyTable SET Quantity=" & Me.Textbox2 & " WHERE Account=" & Me.Textbox1 End If -- Steve Schapel, Microsoft Access MVP John wrote: Steve, Thanks for the response and the tip. Yes, there will there always be 6 textboxes all on the detail section of the form and they represent 3 pairs of values. One or more pairs may be blank. John |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What is the best way to transfer data between forms? | Kamil Dursun | Using Forms | 3 | July 1st, 2004 08:59 PM |
To locate source of data in a form | John | Using Forms | 1 | June 28th, 2004 05:19 AM |
How to syncronize a datasheet form and single form? | Sandra | Using Forms | 9 | June 16th, 2004 05:24 AM |
Mail Merge Form and Data (Word XP) | Sharon | Mailmerge | 1 | May 7th, 2004 10:21 AM |
Validation of cell to enter data | Frank Kabel | Worksheet Functions | 31 | March 9th, 2004 11:01 AM |