Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a character string into a numeric data type
Message
 
À
02/04/1999 22:59:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00204864
Message ID:
00204871
Vues:
17
Jason,
I hope I've understood what you want: You have a Contacts table with Name and ContactID fields, and you want the Name to be displayed. On the form, you should not use a control source for the combo box. In the Valid() or LostFocus() methods store the correct ContactID value to your Office_assignment table. Set BoundColumn to 1 so it continues to show the Name value, but leave ControlSource empty. The combo will continue to show the name after you tab out of it, but your Office_Assignment table will contain the correct ID code.

If you want to show the name in other circumstances (on a grid or report) you might use either a view or set a relation.

HTH
Barbara

>Hi -
>
>I would like to have certain fields on a form returned to their parent table as a character string into a field whose data type has been declared numeric.
>
>For example:
>
>I have a table called office_assignment which has the following fields
>
>nofficeassignid = numeric data type (pk)
>ncontactid = numeric data type
>nofficeid = numric data type
>
>I have created a form for the office_assignment table to input data, called office_assignments. This form has the same fields on the form
>
>nofficeassignid = pk
>nofficeid = numeric data type
>
>
>But, my last field is called: ncontactid
>
>Here I created a combo box, which pulls the first and last name of the contact in the first column (this is placed in the combo box) as well as the contactid (which I have hidden), which is placed in the table.
>
>In addition to having the contacts name appear in the combo box, I would also like for their name to appear in the table, under CONTACTID, so that I can design views and see the contacts names, not just a number.
>
>As it stands now, the office_assignment table looks like this:
>
>noffficeassign id nofficeid ncontactid
> 1 1 3
> 2 2 7
>
>
>
>I would like to have the contacts name appear under ncontactid, versus seeing the numbers 3 & 7.
>
>I hope my question is clear and not too confusing.
>
>
>If anyone has any thoughts on this, I would sure like to hear them.
>jason
>
>TIA
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform