473,394 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

autopopulate fields from one form to another

111 100+
i have a form that allows the user to enter the main information pertaining to a group. i have a button on this form that opens a second form that allows them to enter the individual people of this group and their info. They already entered the Group Name and Group Number on the first form, and i want it to carry over to the second form so that they dont have to retype it. The forms are based on two different tables. Is this possible? i tried using Dlookup, but its not working (or maybe im just not using it correctly). Any ideas?

Thanks!
Aug 9 '07 #1
6 2254
After opening the other form with the docmd.openform you can set the value in it simply from the first form
forms("opened_form_name")("control_name")= forms("First_form_name")("Place_where_GroupID_is_s tored_name")

Some people will perfer the format me.Place_where_GroupID_is_stored_name but I think the first is more complete when your looking at a lot of code.
Aug 9 '07 #2
Neekos
111 100+
hmm that works, but not exactly what i need. It only stays in the first record thats opened on the new form, but as soon as they go to the next record it is gone.
Aug 9 '07 #3
Then the easier way is to pass the form a value or a series of values through the Open arguments (OpenArgs). If you only have one value you could just pass that. Or if you have many sub values you could pass a primary key and get the rest as you go.
Aug 9 '07 #4
Neekos
111 100+
Sorry to be newbish, but im not familiar with the OpenArgs function - can you explain further?

Thanks!
Aug 10 '07 #5
Sure. When you call a form with the docmd.open etc arguments at the end is an OpenArg statement. This is basically a string or a variant (I forget which) which you can pass information to the new form. The new form can reference it with the me.openargs statement. Since it is a pretty flexible thing you can pass the primary key for whatever data you have just requested to be passed. Then on any new record type command you can use that primary key to get the appropriate information out of your table. Sorry for the late reply I took a vacation.
Aug 13 '07 #6
Neekos
111 100+
That's okay - i was able to figure it out without using OpenArgs. I have a button that goes to the next record and just did what you recommened above for the previous form. Thanks though!
Aug 13 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dave | last post by:
Hi folks, I'm in the middle of adding some validation functionality to an inventory tracking form. What I would like to do is have one dropdown menu/Listbox(Part Number) and another text...
3
by: Eric | last post by:
Hi, I'm just looking into the samples that are delivered withthe Enterprise Localization Framework/Toolkit. I have set it up and it all works fine. But.. now i have a question. I read a...
3
by: russr | last post by:
Hi, I need to autopopulate a second field based on the info that i have selected from a drop down box in the first field. I need to write both fields back to a SQL database... EXAMPLE: Field A...
5
by: aharding | last post by:
I would like to autopopulate fields in a form by choosing one value from a table and having the corresponding data filled in based on 'Library' tables I have made. I have been successful in building...
4
by: PRLIT | last post by:
First, let me just say that I've been looking at this site for help for awhile now. Thank you for all the help you given me over the past few months. Second, I'm creating a form in Access 2007. I...
2
by: jw01 | last post by:
I have a form in which there is one combo box and three text boxes: Combo Box: -> Item A -> Item B -> Item C TextBox1: TextBox2: ...
1
by: Darren | last post by:
Hi there. I am a hobbyist with no formal background in computer programming. Although years ago I’ve dabbled with a bit of the Microsoft QBasic and very simple MS-DOS batch files, javascript is...
2
by: debson | last post by:
Hi I have a main form in which I have linked subforms on tabs.. My problem is that I have one subform which is linked to a table which has 2 to 6 sessions in one table, we are required to fill out...
3
by: hkim8392126 | last post by:
I've been searching and reading the forum, but with no success to find what I was looking for. I am trying to autopopulate a field in a form. I am not sure if I need to create a query or table to do...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.