Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to transfer data entered on field to other field automatically? 1

Status
Not open for further replies.

ffleitas

Technical User
Mar 15, 2001
85
US
Hello programmers,

How do I get data just entered on field 1 in a form to transfer to the same form on a different field 2? For example:
Form: frmOrders
Field: Description1
Field: Description2

When I enter data on Form: frmOrders field: Description1 and once I hit tab to move to next field the same data will transfer to Field: Description2.

Thank you,
Felix

 
[tt]
Hi:

You have names for the controls, maybe Text1 and Text2. Better, txtDesc1 and txtDesc2.

In the After Update event of txtDesc1 enter:

Private Sub txtDesc1_AfterUpdate()
Me.txtDesc2 = Me.txtDesc1
End Sub


I hope this is helpful

Gus Brunston [glasses] An old PICKer, using Access2000
[tt]Want solutions you can understand?
Post understandable questions.
[/tt]
 
A related question:

Say that I wanted to do pretty much the same thing, but txtDesc1 is a list box. Every value in the list has an abbreviation related to it (example: "Thompson Data, Inc." has the abbreviation "TDI").

I would imagine that the expression would be similar to the one above, except that txtDesc2 would be pointed towards the field on the table where the abbreviations are saved. How would I go about doing that?
 
.
Hi:

You probably need to start a new thread, but...

1) We all have our own style. That said, I'd think it would be very simple to have an abbreviation field in your company table (tblCompanies?), instead of a separate table for abbreviations, unless the separate table is necessary for other reasons.

2) In your list box, you might have 2 columns, Company name and Company Abbreviation. In the property sheet, you can designate on the Data page that listDesc1 is bound to column 2 (if that's the abbreviation column). Yes, your text box should be pointed at the data source where you want to enter/display/edit the abbreviation.

3) The code could look like:[tt]

Private Sub listDesc1_AfterUpdate()
Me.txtDesc2 = Me.listDesc1
End Sub[/tt]

I hope this helps.

Gus Brunston [glasses] An old PICKer, using Access2000
[tt]Want solutions you can understand?
Post understandable questions.
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top