Simple Syntax Question

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

Guest

Hi there,

I'm still waiting for my VB book to show up with all the syntax explained
and I kinda need to get a small thing done.

The information I'm handling is Service Requests. I have an Is_Closed value
that is manipulated by the user through a check box, if Is_Closed is set to
true then the request has been dealt with.
I also have a Time record that records the time it took to sort out each
request - when a request is first entered the Time_Opened is set to Now() by
default. When it is closed then Now() is evaluated and stored in Time_Closed.
The time taken being Closed - Opened or something like that.

The service handler can re-open a closed service request by clicking on the
check box again, when it is re-closed I want to re-evaluate Time_Closed to
Now().

Here's what I've worked out.

On_Click
If Is_Closed.PreviousValue Is True Then
Is_Closed = False
Else
Is_Closed = True
Time_Closed = Now()
End If
End Sub


The logic I can understand but I don't know any syntax. I've looked around
the net but can't find a decent Syntax site. If anyone could help me out by
translating the above into something resembling VB I'd really appreciate it.

cheers!
 
-----Original Message-----
Hi there,

I'm still waiting for my VB book to show up with all the syntax explained
and I kinda need to get a small thing done.

The information I'm handling is Service Requests. I have an Is_Closed value
that is manipulated by the user through a check box, if Is_Closed is set to
true then the request has been dealt with.
I also have a Time record that records the time it took to sort out each
request - when a request is first entered the Time_Opened is set to Now() by
default. When it is closed then Now() is evaluated and stored in Time_Closed.
The time taken being Closed - Opened or something like that.

The service handler can re-open a closed service request by clicking on the
check box again, when it is re-closed I want to re- evaluate Time_Closed to
Now().

Here's what I've worked out.

On_Click
If Is_Closed.PreviousValue Is True Then
Is_Closed = False
Else
Is_Closed = True
Time_Closed = Now()
End If
End Sub


The logic I can understand but I don't know any syntax. I've looked around
the net but can't find a decent Syntax site. If anyone could help me out by
translating the above into something resembling VB I'd really appreciate it.

cheers!
Hi Nick,

private sub Is_Closed_OnClick()
If Is_Closed then
Time_Closed = Now()
End If
End Sub

A control's initial value is stored in the
property .oldvalue until the user exits the control. Then
the .value replaces the .oldvalue so that both properties
have the same value.

Just a thought... but how do you want to handle the
situation where you have a record that has is_closed =
true and a time_closed. This record is later re-opened.
What do you want to do with the value in the time_closed
field? Perhaps clear it?


private sub Is_Closed_OnClick()
If Is_Closed then
Time_Closed = Now()
Else
Time_Closed = vbnullstring
End If
End Sub

Luck
Jonathan
 
Back
Top