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

Transferring popup calendar date to a text box 3

Status
Not open for further replies.

A10Instructor

Technical User
Feb 7, 2005
27
US
Hi,

I have a combobox that when you click on the arrow, a popup calendar appears. You pick your desired date, and that date is placed into the combo box.

Now my problem...I wish to take the date just placed into the combo box and also place it in a text box located elswhere on the same form. I tried autofilling it like I have with other combo boxes and other text boxes but that doesn't work.

Any ideas?!?!?

Thanks

A10 Instructor
"The World is My Classroom
 
but that doesn't work
What have you tried that doesn't work ?
How is the picked date placed into the combo ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya A10Instructor . . . . .

Curious . . . . [blue]you can assign the date to a combobox but not a textbox[/blue]. There appears to be something you many not have mentioned.

[purple]So . . . just how are you assigning the date to the combobox?[/purple]


Calvin.gif
See Ya! . . . . . .
 
TheAceMan1,

Thanks for responding... I'm using a blank combo box as a means of making the calendar visiable. In other words, when the user clicks the arrow in the combo box, the calendar pops up so the user can pick a date. Once the user picks a date, that date is placed into the combo box that brought up the calendar. Code for combo box is below:

[blue]
Private Sub Comboseldate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
[green]
' Unhide the calendar and give it the focus
[/green]
Calendar4.Visible = True
Calendar4.SetFocus
[green]
' Match calendar date to existing date f present or today's date
[/green]
If Not IsNull(Comboseldate) Then
Calendar4.Value = Comboseldate.Value
Else
Calendar4.Value = Date
End If

End Sub
[/blue]

Now what I'm having trouble with is this...I want to take the date that was just placed into the combo box and place it in a totally different text box somewhere else on the form.

What the form looks looks like is this. The top half of the form is where the user makes all of his selections (i.e. date, name, location , course, etc.) from existing tables. The bottom half is nothing but text boxes that reflect the entire record of each choice selected in the top half.

Hope this helps

Thanks




A10 Instructor
"The World is My Classroom
 
A10Instructor . . . . .

Be aware: [blue]PHV[/blue] is one of the most respected, highly knowledgeable members of the forums here at Tek-Tips.

The code you posted shows opening of the calendar and setting the current value of the calendar. Not how the combo get populated.

In any case what you want is easy enough since the calendar in on the same form. So in the Calendar Event your using to update the combo, add this:
Code:
[blue]Me!YourTextboxName = Me!Calendar4.Value[/blue]

Calvin.gif
See Ya! . . . . . .
 
TheAceMan1,

I apologize for leaving out that part of the code. Here is how the combo box gets populated:

[blue]
Private Sub Calendar4_Click()
[green]
' Copy chosen date from calendar to originating combo box
[/green]
Comboseldate.Value = Calendar4.Value
[green]
' Return the focus to the combo box and hide the calendar
[/green]
Comboseldate.SetFocus
Calendar4.Visible = False

End Sub
[/blue]

A10 Instructor
"The World is My Classroom
 
A10Instructor . . . . .

Modified . . . should be:
Code:
[blue]Private Sub Calendar4_Click()

' Copy chosen date from calendar to originating combo box

    Me!Comboseldate.Value = Calendar4.Value
    [purple][b]Me!YourTextboxName = Me!Calendar4.Value[/b][/purple]

' Return the focus to the combo box and hide the calendar

    Comboseldate.SetFocus
    Calendar4.Visible = False

End Sub[/blue]


Calvin.gif
See Ya! . . . . . .
 
A10Instructor,

Just to simplify things a little, why not have the calendar appear when you DoubleClick the text box you want populated by the date, instead of adding a combobox and then tranferring the date to the text box?

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
TheAceMan1,

Thanks for the suggestion. Once you prompted me about forgetting the other part of the code, I figured out what I needed to do. Your reply confirmed and validated that I was on the right track and that it indeed did work.

Thanks for the help

A10 Instructor
"The World is My Classroom
 
Missinglinq,

You have a valid tip/suggestion. Your method would work just as well. I created the form in the manner that I did because I want the user to verify the data he/she selected prior to continuing onto the next phase which is printing the certificate. We normally print certificates several days to weeks in advance. These are considered controlled documents prior to being awarded, so I need to eliminate as much as possible misprints and other associated errors.

A10 Instructor
"The World is My Classroom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top