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

Using selection in form field option to populate another text box

Status
Not open for further replies.

bmatth1

Programmer
Sep 1, 2003
1
US
I have a text box, with selections from a table (option group). I would like to have another text box populated with a data field based on the selection from the first text box. This will be linked to the same field within the table. For example: The first text box has a selection of dates in the text format (August 4, 2002). Within this same record is the date in the date format: 8/4/2002. I would like to have the date format automatically placed in the second text box based on the selection from the first. If there is a way to convert the date in the first box to a date and display the converted date in the other text box before posting, this would do it - I am stuck either way.
Thank you
Bob
 
I assume that you are programming in VB and this is more properly an issue for the VB Forum and not the General Database forum where I found it ... but anyway ...

I suspect you mean that you have selections from a List box, not a Text box. A textbox has only one value (e.g. Text1.Text) so "Selections" does not really compute. I think that the code that you want is

Text2.Text = Format(CDate(DateString), "m/d/yyyy")

Where "DateString" is the 'List.Text' or 'Text.Text' value that you want formatted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top