Changing Date Field Automatically Based on Information InAnother F

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok here goes.

I have an exisiting database that I'm trying to update. All new fields onto
this report have to go by the following.

I have two Date fields, The first date field is for the current date so
=Date().

The second Date field needs to populate the date only when information is
added to the drop down box that it needs to correspond with. Drop down box
name is Combo131 and second date field is FinalActionDate. If anyone could
give me an idea about this it would be appreciated. I've tried other other
posts on this board but this date field tends to put the exact same date that
is in the first date box.

Thanks for Looking.
 
Sorry, I don't quite understand the question. What do you mean by "populate
the date only when information is added to the drop down box that it needs to
correspond with"? Is your "drop down box" a combo box or a list box? Do you
mean only when a new entry is added or when a user selects one? How do you
know what date to add?

More detailed questions are easier to answer.
 
To place the current date in a field, use...

=Date()

To do this when a control on a form is changed to a particular value, you'd
need to do it in an if statement in that field's "change" event. For
example....



Private Sub Combo131_Change()
If Combo131= "Final" Then
FinalActionDate= Date()
End If
End Sub
 
Ok, this seemed to work pretty good except for one thing. I'm using Access
97, which could be the reason.

Private Sub Combo131_Change()
If Combo131= "Final" Then
FinalActionDate= Date()
End If
End Sub

When I put in Date(), the () deletes automatically and won't save correctly.
However, If I use Now() it stays and works correctly. Any idea on that?
I'd really like to use Date() rather than Now().
 
Don't worry about it. Date is the same as Date(). Access does this to you,
but it understands it.
 
Tried that all ready. When I just make it date it goes me the following

Run-time error '2465'

Microsoft Access can't find the field 'Date' referred to in your expression.

Yada yada and so forth. That's where I'm stuck.
 
Interesting, it works for me. It does the change as you state, then when I
execute it, it returns the date. Don't know what to tell you.
 
Back
Top