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

Populate late one date field from another date field 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
Below is the code I have on two calendars that select dates
for two date fields. When Planned Implementation Date
is clicked, a calendar pops up and a date is selected. When
a date is selected for this field I would like for it to
automatically populate the same date in the Revised
Planned Implementation Date
field. Can this be done.
Also, I would like for the Planned implementation date to
be able to be changed later.

Code:
Private Sub Planned_Implementation_Date_Click()

   CalMain3.Visible = True
   CalMain3.SetFocus
   If Not IsNull([Planned Implementation Date]) Then
      CalMain3.Value = [Planned Implementation Date].Value
   Else
      CalMain3.Value = Date
      
   End If
End Sub
Private Sub CalMain3_Click()

    [Planned Implementation Date].Value = CalMain3.Value
    [Planned Implementation Date].SetFocus
    CalMain3.Visible = False

DoCmd.OpenForm "PopupEcn3", acNormal
Me.Refresh
End Sub
 
This should populate the revised planned implementation date:

Code:
Private Sub CalMain3_Click()

    [Planned Implementation Date].Value = CalMain3.Value
    
    [Revised Planned Implementation Date] = CalMain3.Value

    [Planned Implementation Date].SetFocus
    CalMain3.Visible = False

DoCmd.OpenForm "PopupEcn3", acNormal
Me.Refresh
End Sub

There is nothing in here that stops a field being edited, if there is in your application, it is handled elsewhere in the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top