Combo Box OnChange Event

J

Joe Delphi

Hi,

I am a computer programmer, but I do not have much experience with MS
Access and need some help with expressions.

We have an MS Access 97 database with a form that contains a combo
box. When the user selects the value "CLOSED" for the combo box, I want to
populate another field, the DATE_CLOSED field, with the current date. I
think that I should use the OnChange event of the combo box for doing this,
but I don't know the syntax of the expression that I should use for the
event handler. In pseudo-logic it would be something like this:

if combobox.text = "CLOSED" then
DATE_CLOSED = Date( )

Can someone help me by giving me the correct syntax for this expression?
Can you even do an if statement in Access 97?

Any help appreciated.

Thanks,
JD
 
T

tina

you pretty much have it, though i would probably use the AfterUpdate event,
as

Private Sub ComboBox_AfterUpdate()

If Me!ComboBox = "closed" Then
DATE_CLOSED = Date
End If

End Sub

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top