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

How to have field values transported to fields in another form?

Somebody willing to assist me in the following?
I want to have values from one field copied to another field when I
choose choose a item from a drop down menu.

I have 2 forms:

1 Company contact info
2 Employee contact info

When I finished form 1, I jump to form 2.
There I have to fill in the employee name etc., but also the conpany he
works for (with a drop doenmenu).
When I choosed the company from the list (coming from form 1), I would
like Access thus automatically fills the contact info fields from the
employee wich are probably the same: like company phone, conpany fax,
email.
When the field value is not the same, I still want to have the
possibility to change the values into unique employee contact info. How
to perform this?

This is some info for the VB script:
From:
frmCompany: Control Scourse = PhoneNumber (# company)
Copied to field:
frmEmployee: Control Scourse = Work Phone (# employee)

Bart

Access 2003 / Win xp sp2

Nov 13 '05 #1
2 2071
I would suggest you do this in a completely difeerent way that simplifies
your data entry. First you need tables that look like:
TblCompany
CompanyID
CompanyName
...
...
CompanyPhone
CompanyFax
CompanyEmail

TblEmployee
EmployeeID
CompanyID
FName
MI
LName
...
...
ContactInfoSameAsCompany 'Yes/No
EmployeePhone
EmployeeFax
EmployeeEmail

Data entry would be by a form/subform where the main form is based on a
query based on TblCompany and the subform is based on a query based on
TblEmployee. The subform would be a single form rather than a continuous
form. Put the following code in the AfterUpdate event of
ContactInfoSameAsCompany:
If Me!ContactInfoSameAsCompany = True Then
Me!EmployeePhone = Me.Parent!CompanyPhone
Me!EmployeeFax = Me.Parent!CompanyFax
Me!EmployeeEmail = Me.Parent!CompanyEmail
Else
Me!EmployeePhone = Null
Me!EmployeeFax = Null
Me!EmployeeEmail = Null
End

You don't have to select the company with a combobox, the form/subform
construct automatically takes care of associalting an employee with the
company and the above code autofills EmployeePhone, EmployeeFax and
EmployeeEmail when they are the same as the company's.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com


"AA Arens" <ba***********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Somebody willing to assist me in the following?
I want to have values from one field copied to another field when I
choose choose a item from a drop down menu.

I have 2 forms:

1 Company contact info
2 Employee contact info

When I finished form 1, I jump to form 2.
There I have to fill in the employee name etc., but also the conpany he
works for (with a drop doenmenu).
When I choosed the company from the list (coming from form 1), I would
like Access thus automatically fills the contact info fields from the
employee wich are probably the same: like company phone, conpany fax,
email.
When the field value is not the same, I still want to have the
possibility to change the values into unique employee contact info. How
to perform this?

This is some info for the VB script:
From:
frmCompany: Control Scourse = PhoneNumber (# company)
Copied to field:
frmEmployee: Control Scourse = Work Phone (# employee)

Bart

Access 2003 / Win xp sp2

Nov 13 '05 #2
Thanks for your help, I will find out.

Bart (AA Arens)

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
9
by: jason | last post by:
Access 2000 I need some help interogatting a table and extracting via ASP the final field in a row which has a value. In other words, I have a maximum of 10 fields but, at the user level he may...
8
by: Jack | last post by:
Hi, Here is my problem: I am logging in to a page, where the page retrieves a record from a database. The text boxes are used in the display formto let the users update the fields, if they...
5
by: simon_s_li | last post by:
Hi, I have 5 fields in line where I need to drag and drop the text from one field to another field and then all the fields need to re-order themselves. So for instance if I drag the text in...
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 ...
5
by: Tilfried Weissenberger | last post by:
Hi, I would like to specify a group of Properties/Fields of some objects on a WinForm, for which I would like to have the values loaded from the Registry, and saved to it upon closing of the...
2
by: Simon Harvey | last post by:
Hi all, Is there any easy way to check a field for calues that have changed on a post back. So the page is sent to the user, the user changes some values and I need to know which ones...
2
by: KFactor | last post by:
Is it possible to pass form variables to a page on another server using response.redirect? Or is there a secure way of passing sensitive information from one site to another such as a userID? ...
2
by: DeanL | last post by:
Hi guys, I'm using a subform to display a list of values from a single table. The form is showing the values in "continuous forms" view and there will only ever be two different values for the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...

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.