Can't get text to display on AfterUpdate

KevCB226

Registered User.
Local time
Today, 13:57
Joined
Oct 20, 2005
Messages
24
Hi

I'm having problems trying to get an If statement working on my form.
What I have is a form with two combo boxes linked to a Calendar when you click on the arrow. I can get the dates I select from the calendar into the combo boxes which works perfectly.
What I wanted to do then was create a textbox to list the number of days between each date.
I have created an If statement for me to do this, which works fine.
The problem I am having is that it doesn't seem to update these changes on the form after the date has been changed.

I have placed the code in the AfterUpdate event on both of the combo boxes and also in the Form Current Event.

Anyone any ideas?

If you want to see the If statement let me know, but I don't think it's that.

Thanks
 
Update

See if using the me.refresh or me.requery works for you.
If your IF statement is correct then it just isn't refreshing the data.
Hope this gets you in the right direction.
 
Still not working :(

I have tried requerying both the combo boxes and the textbox that counts the number of days, but it didn't do anything.

I'll post my If statement anyway. This statement is the same in both the AfterUpdate events of the two combo boxes, and the form durrent event.

Code:
If Not Me.StartDate = Me.EndDate Then
    txtDay.Value = DateDiff("d", Me.StartDate, Me.EndDate) + 1
    ElseIf Me.StartDate = Me.EndDate Then
    txtDay.Value = 1
    Else
    txtDay.Value = 0
    End If
    
    EndDate.Requery
    txtDay.Requery

Looks OK to me though. :confused:
 

Users who are viewing this thread

Back
Top Bottom