enter same data in two fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I enter financial data into a form that has a [totals] field, and four other
fields that may contain data, a breakdown of the total.
I would like to be able to enter in a specific form where the total and one
other field would be equal, the total and have the other field reflect that
data. ie enter once but have the value show in two fields.

I am using office/access97
 
Is this second "field" a field or just a textbox (i.e. is it a field in the
underlying table of just a textbox to display the value)? If it is a field
in the underlying table so that you're storing duplicated data, then there
is probably something wrong with your setup. You normally shouldn't store
duplicated data. If the textbox is just for display purposes, you can make
it a calculated control. To do this, you would set its Control Source to an
equation that points to the textbox where you made the entry.

Example:
=[txtEntryTextbox]

Another option would be to place code in the entry textbox's AfterUpdate
event to set the value in the second textbox. If you do it this way and if
the second textbox is unbound, you will also need the same code in the
form's Current event to do the same thing so that the value will update as
you move from record to record.

Example:
Me.txtSecondTextbox = Me.txtEntryTextbox
 
The second, third & forth fields are fields. The first field is a totals $
collected and the other fields are the breakdown of the total into various
deptments.
It is that certain payments go totally into one dept. therefore total and
dept.1 are the same value. by using a specific form I can enter single dept.
data easier if I could solve the need to do double entry.

Wayne Morgan said:
Is this second "field" a field or just a textbox (i.e. is it a field in the
underlying table of just a textbox to display the value)? If it is a field
in the underlying table so that you're storing duplicated data, then there
is probably something wrong with your setup. You normally shouldn't store
duplicated data. If the textbox is just for display purposes, you can make
it a calculated control. To do this, you would set its Control Source to an
equation that points to the textbox where you made the entry.

Example:
=[txtEntryTextbox]

Another option would be to place code in the entry textbox's AfterUpdate
event to set the value in the second textbox. If you do it this way and if
the second textbox is unbound, you will also need the same code in the
form's Current event to do the same thing so that the value will update as
you move from record to record.

Example:
Me.txtSecondTextbox = Me.txtEntryTextbox

--
Wayne Morgan
MS Access MVP


Dennis said:
I enter financial data into a form that has a [totals] field, and four
other
fields that may contain data, a breakdown of the total.
I would like to be able to enter in a specific form where the total and
one
other field would be equal, the total and have the other field reflect
that
data. ie enter once but have the value show in two fields.

I am using office/access97
 
Hi,

you can do the following.

Lets say you have field1 and field2.

Click on field1 in the edit mode and select the roperty section and then
After Update ( I hope I have translated it correct). Click left of the
white field and a button with three dots should show up, choose Code
generator. You will be iin the VBA Section now.

Add this field

Me!field2.value = Me!field1.value do the same for the other field only with
Me!field1.value = Me!field2.value

So when ever you enter into field1 or field2 the other will be updated with
the amunt of have entered.

Hope that helps.

Robert
 
Are you storing the total? If so, why? If you store the break down of the
total, you can calculate the total on the form using a calculated control.
 
Back
Top