473,387 Members | 1,504 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,387 software developers and data experts.

Copy data from one FORM to another FORM

Hi, I am using a form which asks for USER NAME and password. On OK it opens a new FORM in which certain info has to be entered. It also includes USER NAME. i want this field to be populated automaticaly with the USER NAME entered in the privious form. i tried a lot of stuff but was not able to copy the value of previous form field to the field of new form. Urgent help is needed.
Thanks
Aug 18 '06 #1
3 18692
MMcCarthy
14,534 Expert Mod 8TB
Don't close the login form until after the new form has opened.

In the On Load Event of the second form do the following

Me.UserName = Forms("LoginFormName").Controls("UserName")
docmd.close acForm, "LoginFormName"

This will allow you to take the value in the User Name field from the first form before closing it.


Hi, I am using a form which asks for USER NAME and password. On OK it opens a new FORM in which certain info has to be entered. It also includes USER NAME. i want this field to be populated automaticaly with the USER NAME entered in the privious form. i tried a lot of stuff but was not able to copy the value of previous form field to the field of new form. Urgent help is needed.
Thanks
Aug 18 '06 #2
Thanks for the Reply. I have already tried this.
It gives the error

Run time error '-2147352567 (80020009)':
You can't assign a value to this object.

What to do next.
Aug 18 '06 #3
Thanks for the help. i figure out the problem.
This works.
Me.UserName = Forms("LoginFormName").Controls("UserName")
docmd.close acForm, "LoginFormName"
Thanks again
Aug 18 '06 #4

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

Similar topics

3
by: cv | last post by:
Hi all, I have to copy two set of data from 2 files(notepad/excel) say, products and their corresponding prices to list/textarea/table. I should be able to retrieve the product and corresponding...
42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
5
by: NK | last post by:
Hi, We have a webpage that has a form available on the intranet. A user will have a window open that runs a different application open. When the user accesses the webpage and clicks a button we...
5
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
0
by: gary b | last post by:
My forehead is sore from beating it against the wall. Can anyone help? I've started drinking again because of this problem! Setup: ContestantTbl = table ('one' side) HorseTbl = table ...
1
by: Sean Howard | last post by:
Dear All, As is my want I need to do something in Access that seems simple but cannot fathom out. I have main form with two subforms, both datasheets with an almost identical table structure....
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
1
by: David | last post by:
Hi, I have an MS Access app which lets me create a new product by copying data from another selected product. All works fine, except one of the copy updates which I cannot fathom. The code...
1
by: pgreenhill | last post by:
Hi All, I'm creating a Form ("Menu") that has 2 listboxs in it. My problem is that I can't copy the values of each listbox, into another Form's textboxs. The idea is that users can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.