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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate table data is displayed in multiple textboxes

Status
Not open for further replies.

iara84

Systems Engineer
Oct 25, 2022
13
CO
How to make the data shown in the textbox not be repeated if not the data that the table has

I have added the following code to the init of the form

Thisform.TxtNomCli.ControlSource = "customers2.name"
Thisform.TxtIdent.ControlSource = "customers2.identify"
Thisform.TxtAddress.ControlSource = "customers2.address"
Thisform.TxtTele.ControlSource = "customers2.phone"

Thisform.TxtNomCli2.ControlSource = "customers2.name"
Thisform.TxtIdent2.ControlSource = "customers2.identify"
Thisform.TxtDirec2.ControlSource = "customers2.address"
Thisform.TxtTele2.ControlSource = "customers2.phone
 
What do ou expect, do you expect two rows to show? Your controlsources are the same table, so binding to the same fields you show the same data.

The only controls that display multiple records of a table are grid, listbox, and combobox.
Other controls show the value of the current record. And that current record is a basic principle of any workarea, it has a record pointer that either points at one record or at EOF. Even a filter that has 2 or more records won't give you two record pointer.

You can do two queries into two cursors, one for each group of controls.

You could also USE Customers ALIAS customers1 and then USE customers AGAIN ALIAS customers2. Then you have two workareas on the same table and have two record pointers. These are bound to the workarea, not the DBF file.
Maybe you wanted to bind to customers1 and customers2, but your post says you bound both groups of controls to customers2. Of course you see the same record in them.

Oh, and I forgot to mention, even if you use a table twice with different alias names, the record pointers both start at recno 1 (or the first undeleted recno, if you SET DLETED ON)

Chriss
 
using the table with two different alias customers1 and customers2, how would I do so that from the tetxbox Thisform.TxtNomCli.ControlSource = "customers.name" to Thisform.TxtTele.ControlSource = "customers.phone" the first row of the table would be shown and from Thisform. TxtNomCli2.ControlSource = "customers2.name" until Thisform.TxtTele2.ControlSource = "customers2.phone" the second row of the table will be displayed, is there any way to achieve it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top