AfterUpdate Question!

I want to add this to my code , Ony enter date if [DateCheck] (checkbox) 
is -1
Any help would be great..............Thanks Bob

Private Sub tbAdditionCharge_AfterUpdate()
If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
    tbDayNo.value = Format(Now, "dd-mmm-yy")

End If
End Sub 


0
Bob
9/1/2007 2:07:58 AM
access 16762 articles. 2 followers. Follow

8 Replies
481 Views

Similar Articles

[PageSpeed] 10


Hi Bob,

Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
Format(Date,"dd/mm/yy"),tbDayNo)

Regards
Jacob



"Bob V" <rjvance@ihug.co.nz> wrote in message 
news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
|
| I want to add this to my code , Ony enter date if [DateCheck] (checkbox)
| is -1
| Any help would be great..............Thanks Bob
|
| Private Sub tbAdditionCharge_AfterUpdate()
| If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
|    tbDayNo.value = Format(Now, "dd-mmm-yy")
|
| End If
| End Sub
|
| 


0
JK
9/1/2007 3:11:47 AM
Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works from a 
shortcut to enter in Additional Charges...Thanks for any Help....Bob

Private Sub cbChargeID_AfterUpdate()
    If cbChargeID.Text = "" Then
        Exit Sub
    End If
Dim recAdditionalCharges As New ADODB.Recordset
    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE 
ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection, 
adOpenDynamic, adLockOptimistic
    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = True 
Then
        Exit Sub
    End If
       tbDayNo.value = Format(Now, "dd-mmm-yy")
    tbAdditionCharge.value = 
recAdditionalCharges.Fields("ChargeDescription")
    tbAdditionChargeAmount.value = 
recAdditionalCharges.Fields("ChargeAmount")
    recAdditionalCharges.Close
    Set recAdditionalCharges = Nothing

End Sub

"JK" <nobody@home.now> wrote in message 
news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
>
>
> Hi Bob,
>
> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
> Format(Date,"dd/mm/yy"),tbDayNo)
>
> Regards
> Jacob
>
>
>
> "Bob V" <rjvance@ihug.co.nz> wrote in message
> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
> |
> | I want to add this to my code , Ony enter date if [DateCheck] (checkbox)
> | is -1
> | Any help would be great..............Thanks Bob
> |
> | Private Sub tbAdditionCharge_AfterUpdate()
> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
> |
> | End If
> | End Sub
> |
> |
>
> 


0
Bob
9/1/2007 10:42:03 PM
I am getting my check box [DateFlag] to show the correct 0 and -1 when I 
enter a record on my continuous form but the codes are not stopping the date 
from being entered, when I close the form and open it they all turn to 
zero's but that should not matter because its only when I enter a new record 
that the date is not to enter, any thoughts ................Regards Bob

Private Sub tbAdditionCharge_AfterUpdate()
  Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
Format(Date, "dd/mm/yy"), tbDayNo)

'If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
    'tbDayNo.value = Format(Now, "dd-mmm-yy")

End Sub


"Bob V" <rjvance@ihug.co.nz> wrote in message 
news:%23x9eClO7HHA.4736@TK2MSFTNGP06.phx.gbl...
> Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works from a 
> shortcut to enter in Additional Charges...Thanks for any Help....Bob
>
> Private Sub cbChargeID_AfterUpdate()
>    If cbChargeID.Text = "" Then
>        Exit Sub
>    End If
> Dim recAdditionalCharges As New ADODB.Recordset
>    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE 
> ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection, 
> adOpenDynamic, adLockOptimistic
>    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = True 
> Then
>        Exit Sub
>    End If
>       tbDayNo.value = Format(Now, "dd-mmm-yy")
>    tbAdditionCharge.value = 
> recAdditionalCharges.Fields("ChargeDescription")
>    tbAdditionChargeAmount.value = 
> recAdditionalCharges.Fields("ChargeAmount")
>    recAdditionalCharges.Close
>    Set recAdditionalCharges = Nothing
>
> End Sub
>
> "JK" <nobody@home.now> wrote in message 
> news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
>>
>>
>> Hi Bob,
>>
>> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
>> Format(Date,"dd/mm/yy"),tbDayNo)
>>
>> Regards
>> Jacob
>>
>>
>>
>> "Bob V" <rjvance@ihug.co.nz> wrote in message
>> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
>> |
>> | I want to add this to my code , Ony enter date if [DateCheck] 
>> (checkbox)
>> | is -1
>> | Any help would be great..............Thanks Bob
>> |
>> | Private Sub tbAdditionCharge_AfterUpdate()
>> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
>> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
>> |
>> | End If
>> | End Sub
>> |
>> |
>>
>>
>
> 


0
Bob
9/2/2007 12:44:05 AM
Hi Bob,

If you want to disable a field when you are in a new record, use the 
OnCurrent event:

    Me.tbDayNo.Enabled=IIf(Me.Form.NewRecrod,False,True)

Regards/Jacob



"Bob V" <rjvance@ihug.co.nz> wrote in message 
news:OuwkOpP7HHA.4712@TK2MSFTNGP04.phx.gbl...
|I am getting my check box [DateFlag] to show the correct 0 and -1 when I
| enter a record on my continuous form but the codes are not stopping the 
date
| from being entered, when I close the form and open it they all turn to
| zero's but that should not matter because its only when I enter a new 
record
| that the date is not to enter, any thoughts ................Regards Bob
|
| Private Sub tbAdditionCharge_AfterUpdate()
|  Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
| Format(Date, "dd/mm/yy"), tbDayNo)
|
| 'If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
|    'tbDayNo.value = Format(Now, "dd-mmm-yy")
|
| End Sub
|
|
| "Bob V" <rjvance@ihug.co.nz> wrote in message
| news:%23x9eClO7HHA.4736@TK2MSFTNGP06.phx.gbl...
| > Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works from 
a
| > shortcut to enter in Additional Charges...Thanks for any Help....Bob
| >
| > Private Sub cbChargeID_AfterUpdate()
| >    If cbChargeID.Text = "" Then
| >        Exit Sub
| >    End If
| > Dim recAdditionalCharges As New ADODB.Recordset
| >    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE
| > ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection,
| > adOpenDynamic, adLockOptimistic
| >    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = 
True
| > Then
| >        Exit Sub
| >    End If
| >       tbDayNo.value = Format(Now, "dd-mmm-yy")
| >    tbAdditionCharge.value =
| > recAdditionalCharges.Fields("ChargeDescription")
| >    tbAdditionChargeAmount.value =
| > recAdditionalCharges.Fields("ChargeAmount")
| >    recAdditionalCharges.Close
| >    Set recAdditionalCharges = Nothing
| >
| > End Sub
| >
| > "JK" <nobody@home.now> wrote in message
| > news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
| >>
| >>
| >> Hi Bob,
| >>
| >> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
| >> Format(Date,"dd/mm/yy"),tbDayNo)
| >>
| >> Regards
| >> Jacob
| >>
| >>
| >>
| >> "Bob V" <rjvance@ihug.co.nz> wrote in message
| >> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
| >> |
| >> | I want to add this to my code , Ony enter date if [DateCheck]
| >> (checkbox)
| >> | is -1
| >> | Any help would be great..............Thanks Bob
| >> |
| >> | Private Sub tbAdditionCharge_AfterUpdate()
| >> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
| >> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
| >> |
| >> | End If
| >> | End Sub
| >> |
| >> |
| >>
| >>
| >
| >
|
| 


0
JK
9/2/2007 1:18:11 AM
Got It :) Worked it out Brilliant Thanks Guys ( JK that Horse flue Virus not 
good for NSW!)
Private Sub cbChargeID_AfterUpdate()
    If cbChargeID.Text = "" Then
        Exit Sub
    End If
Dim recAdditionalCharges As New ADODB.Recordset
    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE 
ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection, 
adOpenDynamic, adLockOptimistic
    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = True 
Then
        Exit Sub
    End If

    tbAdditionCharge.value = 
recAdditionalCharges.Fields("ChargeDescription")
    tbAdditionChargeAmount.value = 
recAdditionalCharges.Fields("ChargeAmount")
    tbDateFlag.value = recAdditionalCharges.Fields("DateFlag")
    Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
Format(Date, "dd/mm/yy"), tbDayNo)
      recAdditionalCharges.Close
    Set recAdditionalCharges = Nothing

End Sub

"JK" <nobody@home.now> wrote in message 
news:OOrTi8P7HHA.4660@TK2MSFTNGP02.phx.gbl...
> Hi Bob,
>
> If you want to disable a field when you are in a new record, use the
> OnCurrent event:
>
>    Me.tbDayNo.Enabled=IIf(Me.Form.NewRecrod,False,True)
>
> Regards/Jacob
>
>
>
> "Bob V" <rjvance@ihug.co.nz> wrote in message
> news:OuwkOpP7HHA.4712@TK2MSFTNGP04.phx.gbl...
> |I am getting my check box [DateFlag] to show the correct 0 and -1 when I
> | enter a record on my continuous form but the codes are not stopping the
> date
> | from being entered, when I close the form and open it they all turn to
> | zero's but that should not matter because its only when I enter a new
> record
> | that the date is not to enter, any thoughts ................Regards Bob
> |
> | Private Sub tbAdditionCharge_AfterUpdate()
> |  Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
> | Format(Date, "dd/mm/yy"), tbDayNo)
> |
> | 'If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
> |    'tbDayNo.value = Format(Now, "dd-mmm-yy")
> |
> | End Sub
> |
> |
> | "Bob V" <rjvance@ihug.co.nz> wrote in message
> | news:%23x9eClO7HHA.4736@TK2MSFTNGP06.phx.gbl...
> | > Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works 
> from
> a
> | > shortcut to enter in Additional Charges...Thanks for any Help....Bob
> | >
> | > Private Sub cbChargeID_AfterUpdate()
> | >    If cbChargeID.Text = "" Then
> | >        Exit Sub
> | >    End If
> | > Dim recAdditionalCharges As New ADODB.Recordset
> | >    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE
> | > ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection,
> | > adOpenDynamic, adLockOptimistic
> | >    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF =
> True
> | > Then
> | >        Exit Sub
> | >    End If
> | >       tbDayNo.value = Format(Now, "dd-mmm-yy")
> | >    tbAdditionCharge.value =
> | > recAdditionalCharges.Fields("ChargeDescription")
> | >    tbAdditionChargeAmount.value =
> | > recAdditionalCharges.Fields("ChargeAmount")
> | >    recAdditionalCharges.Close
> | >    Set recAdditionalCharges = Nothing
> | >
> | > End Sub
> | >
> | > "JK" <nobody@home.now> wrote in message
> | > news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
> | >>
> | >>
> | >> Hi Bob,
> | >>
> | >> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
> | >> Format(Date,"dd/mm/yy"),tbDayNo)
> | >>
> | >> Regards
> | >> Jacob
> | >>
> | >>
> | >>
> | >> "Bob V" <rjvance@ihug.co.nz> wrote in message
> | >> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
> | >> |
> | >> | I want to add this to my code , Ony enter date if [DateCheck]
> | >> (checkbox)
> | >> | is -1
> | >> | Any help would be great..............Thanks Bob
> | >> |
> | >> | Private Sub tbAdditionCharge_AfterUpdate()
> | >> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
> | >> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
> | >> |
> | >> | End If
> | >> | End Sub
> | >> |
> | >> |
> | >>
> | >>
> | >
> | >
> |
> |
>
> 


0
Bob
9/2/2007 4:36:38 AM
Oops one problem how do I change the code so as 0 shows the Date and -1 dose 
not show date..thanks Bob
Could not change IsNull for IsNotNull !

"Bob V" <rjvance@ihug.co.nz> wrote in message 
news:eOvxKrR7HHA.1184@TK2MSFTNGP04.phx.gbl...
> Got It :) Worked it out Brilliant Thanks Guys ( JK that Horse flue Virus 
> not good for NSW!)
> Private Sub cbChargeID_AfterUpdate()
>    If cbChargeID.Text = "" Then
>        Exit Sub
>    End If
> Dim recAdditionalCharges As New ADODB.Recordset
>    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE 
> ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection, 
> adOpenDynamic, adLockOptimistic
>    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = True 
> Then
>        Exit Sub
>    End If
>
>    tbAdditionCharge.value = 
> recAdditionalCharges.Fields("ChargeDescription")
>    tbAdditionChargeAmount.value = 
> recAdditionalCharges.Fields("ChargeAmount")
>    tbDateFlag.value = recAdditionalCharges.Fields("DateFlag")
>    Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
> Format(Date, "dd/mm/yy"), tbDayNo)
>      recAdditionalCharges.Close
>    Set recAdditionalCharges = Nothing
>
> End Sub
>
> "JK" <nobody@home.now> wrote in message 
> news:OOrTi8P7HHA.4660@TK2MSFTNGP02.phx.gbl...
>> Hi Bob,
>>
>> If you want to disable a field when you are in a new record, use the
>> OnCurrent event:
>>
>>    Me.tbDayNo.Enabled=IIf(Me.Form.NewRecrod,False,True)
>>
>> Regards/Jacob
>>
>>
>>
>> "Bob V" <rjvance@ihug.co.nz> wrote in message
>> news:OuwkOpP7HHA.4712@TK2MSFTNGP04.phx.gbl...
>> |I am getting my check box [DateFlag] to show the correct 0 and -1 when I
>> | enter a record on my continuous form but the codes are not stopping the
>> date
>> | from being entered, when I close the form and open it they all turn to
>> | zero's but that should not matter because its only when I enter a new
>> record
>> | that the date is not to enter, any thoughts ................Regards Bob
>> |
>> | Private Sub tbAdditionCharge_AfterUpdate()
>> |  Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
>> | Format(Date, "dd/mm/yy"), tbDayNo)
>> |
>> | 'If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
>> |    'tbDayNo.value = Format(Now, "dd-mmm-yy")
>> |
>> | End Sub
>> |
>> |
>> | "Bob V" <rjvance@ihug.co.nz> wrote in message
>> | news:%23x9eClO7HHA.4736@TK2MSFTNGP06.phx.gbl...
>> | > Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works 
>> from
>> a
>> | > shortcut to enter in Additional Charges...Thanks for any Help....Bob
>> | >
>> | > Private Sub cbChargeID_AfterUpdate()
>> | >    If cbChargeID.Text = "" Then
>> | >        Exit Sub
>> | >    End If
>> | > Dim recAdditionalCharges As New ADODB.Recordset
>> | >    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges 
>> WHERE
>> | > ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection,
>> | > adOpenDynamic, adLockOptimistic
>> | >    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF =
>> True
>> | > Then
>> | >        Exit Sub
>> | >    End If
>> | >       tbDayNo.value = Format(Now, "dd-mmm-yy")
>> | >    tbAdditionCharge.value =
>> | > recAdditionalCharges.Fields("ChargeDescription")
>> | >    tbAdditionChargeAmount.value =
>> | > recAdditionalCharges.Fields("ChargeAmount")
>> | >    recAdditionalCharges.Close
>> | >    Set recAdditionalCharges = Nothing
>> | >
>> | > End Sub
>> | >
>> | > "JK" <nobody@home.now> wrote in message
>> | > news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
>> | >>
>> | >>
>> | >> Hi Bob,
>> | >>
>> | >> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
>> | >> Format(Date,"dd/mm/yy"),tbDayNo)
>> | >>
>> | >> Regards
>> | >> Jacob
>> | >>
>> | >>
>> | >>
>> | >> "Bob V" <rjvance@ihug.co.nz> wrote in message
>> | >> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
>> | >> |
>> | >> | I want to add this to my code , Ony enter date if [DateCheck]
>> | >> (checkbox)
>> | >> | is -1
>> | >> | Any help would be great..............Thanks Bob
>> | >> |
>> | >> | Private Sub tbAdditionCharge_AfterUpdate()
>> | >> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
>> | >> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
>> | >> |
>> | >> | End If
>> | >> | End Sub
>> | >> |
>> | >> |
>> | >>
>> | >>
>> | >
>> | >
>> |
>> |
>>
>>
>
> 


0
Bob
9/2/2007 5:01:22 AM
Sorry Im an Idiot, I have to flag tbAddionalCharge so as it will enter date 
or not when it is Null or Not Null. I will give it a go :)...Thanks Bob
"Bob V" <rjvance@ihug.co.nz> wrote in message 
news:OUVV$4R7HHA.5136@TK2MSFTNGP02.phx.gbl...
> Oops one problem how do I change the code so as 0 shows the Date and -1 
> dose not show date..thanks Bob
> Could not change IsNull for IsNotNull !
>
> "Bob V" <rjvance@ihug.co.nz> wrote in message 
> news:eOvxKrR7HHA.1184@TK2MSFTNGP04.phx.gbl...
>> Got It :) Worked it out Brilliant Thanks Guys ( JK that Horse flue Virus 
>> not good for NSW!)
>> Private Sub cbChargeID_AfterUpdate()
>>    If cbChargeID.Text = "" Then
>>        Exit Sub
>>    End If
>> Dim recAdditionalCharges As New ADODB.Recordset
>>    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE 
>> ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection, 
>> adOpenDynamic, adLockOptimistic
>>    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = True 
>> Then
>>        Exit Sub
>>    End If
>>
>>    tbAdditionCharge.value = 
>> recAdditionalCharges.Fields("ChargeDescription")
>>    tbAdditionChargeAmount.value = 
>> recAdditionalCharges.Fields("ChargeAmount")
>>    tbDateFlag.value = recAdditionalCharges.Fields("DateFlag")
>>    Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
>> Format(Date, "dd/mm/yy"), tbDayNo)
>>      recAdditionalCharges.Close
>>    Set recAdditionalCharges = Nothing
>>
>> End Sub
>>
>> "JK" <nobody@home.now> wrote in message 
>> news:OOrTi8P7HHA.4660@TK2MSFTNGP02.phx.gbl...
>>> Hi Bob,
>>>
>>> If you want to disable a field when you are in a new record, use the
>>> OnCurrent event:
>>>
>>>    Me.tbDayNo.Enabled=IIf(Me.Form.NewRecrod,False,True)
>>>
>>> Regards/Jacob
>>>
>>>
>>>
>>> "Bob V" <rjvance@ihug.co.nz> wrote in message
>>> news:OuwkOpP7HHA.4712@TK2MSFTNGP04.phx.gbl...
>>> |I am getting my check box [DateFlag] to show the correct 0 and -1 when 
>>> I
>>> | enter a record on my continuous form but the codes are not stopping 
>>> the
>>> date
>>> | from being entered, when I close the form and open it they all turn to
>>> | zero's but that should not matter because its only when I enter a new
>>> record
>>> | that the date is not to enter, any thoughts ................Regards 
>>> Bob
>>> |
>>> | Private Sub tbAdditionCharge_AfterUpdate()
>>> |  Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
>>> | Format(Date, "dd/mm/yy"), tbDayNo)
>>> |
>>> | 'If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
>>> |    'tbDayNo.value = Format(Now, "dd-mmm-yy")
>>> |
>>> | End Sub
>>> |
>>> |
>>> | "Bob V" <rjvance@ihug.co.nz> wrote in message
>>> | news:%23x9eClO7HHA.4736@TK2MSFTNGP06.phx.gbl...
>>> | > Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works 
>>> from
>>> a
>>> | > shortcut to enter in Additional Charges...Thanks for any Help....Bob
>>> | >
>>> | > Private Sub cbChargeID_AfterUpdate()
>>> | >    If cbChargeID.Text = "" Then
>>> | >        Exit Sub
>>> | >    End If
>>> | > Dim recAdditionalCharges As New ADODB.Recordset
>>> | >    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges 
>>> WHERE
>>> | > ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection,
>>> | > adOpenDynamic, adLockOptimistic
>>> | >    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF =
>>> True
>>> | > Then
>>> | >        Exit Sub
>>> | >    End If
>>> | >       tbDayNo.value = Format(Now, "dd-mmm-yy")
>>> | >    tbAdditionCharge.value =
>>> | > recAdditionalCharges.Fields("ChargeDescription")
>>> | >    tbAdditionChargeAmount.value =
>>> | > recAdditionalCharges.Fields("ChargeAmount")
>>> | >    recAdditionalCharges.Close
>>> | >    Set recAdditionalCharges = Nothing
>>> | >
>>> | > End Sub
>>> | >
>>> | > "JK" <nobody@home.now> wrote in message
>>> | > news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
>>> | >>
>>> | >>
>>> | >> Hi Bob,
>>> | >>
>>> | >> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
>>> | >> Format(Date,"dd/mm/yy"),tbDayNo)
>>> | >>
>>> | >> Regards
>>> | >> Jacob
>>> | >>
>>> | >>
>>> | >>
>>> | >> "Bob V" <rjvance@ihug.co.nz> wrote in message
>>> | >> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
>>> | >> |
>>> | >> | I want to add this to my code , Ony enter date if [DateCheck]
>>> | >> (checkbox)
>>> | >> | is -1
>>> | >> | Any help would be great..............Thanks Bob
>>> | >> |
>>> | >> | Private Sub tbAdditionCharge_AfterUpdate()
>>> | >> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
>>> | >> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
>>> | >> |
>>> | >> | End If
>>> | >> | End Sub
>>> | >> |
>>> | >> |
>>> | >>
>>> | >>
>>> | >
>>> | >
>>> |
>>> |
>>>
>>>
>>
>>
>
> 


0
Bob
9/2/2007 6:00:08 AM
Horse flu makes horse a bit hoarse :-o
It is a bloody disaster in NSW (and Southern Qld.)

J


"Bob V" <rjvance@ihug.co.nz> wrote in message 
news:eOvxKrR7HHA.1184@TK2MSFTNGP04.phx.gbl...
| Got It :) Worked it out Brilliant Thanks Guys ( JK that Horse flue Virus 
not
| good for NSW!)
| Private Sub cbChargeID_AfterUpdate()
|    If cbChargeID.Text = "" Then
|        Exit Sub
|    End If
| Dim recAdditionalCharges As New ADODB.Recordset
|    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges WHERE
| ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection,
| adOpenDynamic, adLockOptimistic
|    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF = True
| Then
|        Exit Sub
|    End If
|
|    tbAdditionCharge.value =
| recAdditionalCharges.Fields("ChargeDescription")
|    tbAdditionChargeAmount.value =
| recAdditionalCharges.Fields("ChargeAmount")
|    tbDateFlag.value = recAdditionalCharges.Fields("DateFlag")
|    Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
| Format(Date, "dd/mm/yy"), tbDayNo)
|      recAdditionalCharges.Close
|    Set recAdditionalCharges = Nothing
|
| End Sub
|
| "JK" <nobody@home.now> wrote in message
| news:OOrTi8P7HHA.4660@TK2MSFTNGP02.phx.gbl...
| > Hi Bob,
| >
| > If you want to disable a field when you are in a new record, use the
| > OnCurrent event:
| >
| >    Me.tbDayNo.Enabled=IIf(Me.Form.NewRecrod,False,True)
| >
| > Regards/Jacob
| >
| >
| >
| > "Bob V" <rjvance@ihug.co.nz> wrote in message
| > news:OuwkOpP7HHA.4712@TK2MSFTNGP04.phx.gbl...
| > |I am getting my check box [DateFlag] to show the correct 0 and -1 when 
I
| > | enter a record on my continuous form but the codes are not stopping 
the
| > date
| > | from being entered, when I close the form and open it they all turn to
| > | zero's but that should not matter because its only when I enter a new
| > record
| > | that the date is not to enter, any thoughts ................Regards 
Bob
| > |
| > | Private Sub tbAdditionCharge_AfterUpdate()
| > |  Me.tbDayNo = IIf(Me.DateFlag And IsNull(tbDayNo), _
| > | Format(Date, "dd/mm/yy"), tbDayNo)
| > |
| > | 'If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
| > |    'tbDayNo.value = Format(Now, "dd-mmm-yy")
| > |
| > | End Sub
| > |
| > |
| > | "Bob V" <rjvance@ihug.co.nz> wrote in message
| > | news:%23x9eClO7HHA.4736@TK2MSFTNGP06.phx.gbl...
| > | > Sorry Guys, gave you the wrong AfterUpdate, This afterUpdate works
| > from
| > a
| > | > shortcut to enter in Additional Charges...Thanks for any Help....Bob
| > | >
| > | > Private Sub cbChargeID_AfterUpdate()
| > | >    If cbChargeID.Text = "" Then
| > | >        Exit Sub
| > | >    End If
| > | > Dim recAdditionalCharges As New ADODB.Recordset
| > | >    recAdditionalCharges.Open "SELECT * FROM tblAdditionalCharges 
WHERE
| > | > ChargeID LIKE '" & cbChargeID.Text & "'", CurrentProject.Connection,
| > | > adOpenDynamic, adLockOptimistic
| > | >    If recAdditionalCharges.EOF = True And recAdditionalCharges.BOF =
| > True
| > | > Then
| > | >        Exit Sub
| > | >    End If
| > | >       tbDayNo.value = Format(Now, "dd-mmm-yy")
| > | >    tbAdditionCharge.value =
| > | > recAdditionalCharges.Fields("ChargeDescription")
| > | >    tbAdditionChargeAmount.value =
| > | > recAdditionalCharges.Fields("ChargeAmount")
| > | >    recAdditionalCharges.Close
| > | >    Set recAdditionalCharges = Nothing
| > | >
| > | > End Sub
| > | >
| > | > "JK" <nobody@home.now> wrote in message
| > | > news:u9ZTaXE7HHA.1212@TK2MSFTNGP05.phx.gbl...
| > | >>
| > | >>
| > | >> Hi Bob,
| > | >>
| > | >> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
| > | >> Format(Date,"dd/mm/yy"),tbDayNo)
| > | >>
| > | >> Regards
| > | >> Jacob
| > | >>
| > | >>
| > | >>
| > | >> "Bob V" <rjvance@ihug.co.nz> wrote in message
| > | >> news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl...
| > | >> |
| > | >> | I want to add this to my code , Ony enter date if [DateCheck]
| > | >> (checkbox)
| > | >> | is -1
| > | >> | Any help would be great..............Thanks Bob
| > | >> |
| > | >> | Private Sub tbAdditionCharge_AfterUpdate()
| > | >> | If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then
| > | >> |    tbDayNo.value = Format(Now, "dd-mmm-yy")
| > | >> |
| > | >> | End If
| > | >> | End Sub
| > | >> |
| > | >> |
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
| 


0
JK
9/2/2007 7:52:17 AM
Reply:

Similar Artilces:

Extender Questions
We are a Great Plains 8.0 User, and have an Extender window tied to the Item Number and a field with a List Field type. 1) Currently, this List consists of 25 different values. We want to reduce it to two values. We can change the first two values, and delete the values of the other 23. When we do this, the blank rows still exist in the dropdown. Is there a way to compress this list and eliminate the blank rows? 2) We have 13,000 items linked to this list, and would like to update the values to one of the two remaining items in the list directly in the tables. We have determined...

not a vc++ question
Hi, I have msdn installed on my system(full installation) and I have been using it fine for over an year. Now suddenly I get this always "The page cannot be displayed" Can someone what setting is causing this? Thanks Vipin It sounds suspiciously like some or all of the files in your MSDN directory are damaged, or deleted. Just a guess. joe On Mon, 27 Jun 2005 03:09:25 +0530, "Vipin" <Vipin@nospam.com> wrote: >Hi, > I have msdn installed on my system(full installation) and I have been >using it fine for over an year. Now suddenly I ge...

AfterUpdate/BeforeUpdate and SetFocus
I have some problems with the SetFocus command in a Userform with an AfterUpdate or BeforeUpdate routine. To make it clear to you, I made a very small Userform to demonstrate it. It only contains 8 TextBoxes and this code: Code: Private Sub TextBox01_AfterUpdate() Me.TextBox08.SetFocus End Sub - Private Sub TextBox02_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox03_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox04_Change() TextBox08.SetFocus End Sub I expected that in ...

OE to Outlook questions
We are thinking of using Outlook (2000) rather than OE because we would like to filter on message headers, but have some questions:- Can I decide where the email cabinet is to be located in Outlook as in OE so that I can get at it? I use E-backup to BU my OE system on a schedule - is there a similar program for Outlook? Can I collect my Hotmail in Outlook and how do I configure it? Can I use Newsgroups in Outlook and how do I do it? Can I share my email system by having the cabinet on my server? Thanks for any help in advance Maggie Tuthill Inline - Tuthill wrote: > We ar...

How too questions
I have a couple of questions? I was hoping you could lead me in the right direction! How do I take a deposit amount and leave the rest open without putting an amount on account or anything like that? How do I print a pick ticket to the warehouse with no pricing information on it? How do I look at the cost and profit of an item on screen after I add it to the invoice? How can I change the picture that is on the POS screen at the top? Hope you can direct me in the right place for these questions. Sincerely, Bryan Harrington Sunrise Technology Group, Incorporated A Division of The Harringt...

Question about rtf files
Hi, I use rtf files for the help file in several programs and was wondering if there was anyway to make bookmarks and hyperlinks in an rtf file? I have created the files with both bookmarks and hyperlinks in Word and then saved the file as an rtf, but the hyperlinks do not carry over. Does anyone know of a way to do this? Or should I just invest in a program to convert Word files to chm files? Any help or direction appreciated. Thanks, Norm "Norm" <NormF4@spoof.com> wrote in message news:50C30EC0-6CF4-4A10-93CF-C063BB6422B7@microsoft.com... >...

Database design question
Just curious about any drawbacks to this type of database design. There is an organization table that has many types of organizations and structures dealing with organizations in it such as: Company, Region, Market, etc There is another table that is the linking table for all the organizations. The type of relationship you are looking at is by a RecordTypeID. So in essence, it is like having 6 diffent tables in one table with about 12+ different mapping tables in another table. So your queries would look something like: SELECT * FROM Organization Company JOIN Organ...

Payroll Question
Could somebody that's a little more into payroll than I am help me out here. At the end of the year, does the previous payroll year have to be closed and the W-2's printed before checks for the next year can be cut? -- Japheth Nolt Microsoft SBF Specialist Landis Computer www.landiscomputer.com 8/22/2007 10:26:03 AM You do not have to print W2s before you process payroll runs in the new year. You do have to run the routine to create the year end file before you process W2s or do transactions in the new year. The year end processing articles have a lot of details on steps. -- Ch...

Drop Down Question
At one point, I think I read dynamic drop down would be possible with crm 3.0. Is this true? If so, can you link me to some documentation or sample code in how I can do this? Let me describe what I’m trying to accomplish. I’m looking to propagate a referrals drop down based on the challenges records in a custom entity I created. So, the parent drop down would provide a list of the distinct challenges. When one is selected, it would fill the referral drop down with all the referrals available with a challenge type of the parent drop down. Possible? Thanks for your help! ...

Some generic questions about UDFs
I have a small collection of UDFs some kindly provided by members of this newsgroup. I've searched the net but I can't seem to find answers to the following questions: 1st Ques: Ideally I would like the 2nd half of the UDF's [function argument] box to provide additional information, like Excel's integral functions. I definitely do not want to incorporate a help file. Is it possible to add additional code to the UDF so a small description is displayed? They are for my own use so I don't want to go to the palaver of learning how to do add-ins or produce help files. 2nd Que...

Excel guru question..
I have a table, 4w x 10h. I input data into A1-A10 and B1-B10. The data is converted into values in C1-C10 and D1-10. I need the data in the following format: C1,D1 C2,D2 C3,D3 C4,D4 C5,D5 C6,D6 C7,D7 C8,D8 C9,D9 C10,D10 ....all in one cell and with the commas included. I know there's a way to do this, but damn if I can remember it. Anyone? -- Bryan S. Slick, onyx_hokie at yahoo dot com "Violence is the last refuge of the incompetent." (Salvor Hardin in 'Foundation', Isaac Asimov) You could do it manually, but a macro is much quicker. Sub ConCat_Cells() Di...

Mail Routing Question.
I have an Exchange 2003 Server. My client would like for all mail to be sent to the internet, no internal x400 mail. He wants this because he is away from the office quuite a bit and syncs his phone with the ISP, receives all external email, but none from his office. He does not have a compatible phone yet for Exchange Activesync. How would I set it up on the server to have all mail go through the Internet. Thank you. Keith Your question is a little confusing please clarify. SMTP is native to Exchange 2003 and while the X400 protocol is available by default it is not used. If you set...

question #2
how to format x - axis scale , minor and major ...

Morbid Categories Question
How have others who have lost loved ones categorized their final expenses (casket, funeral, plot, monument, etc.)? TIA. Never done it. I'm thinking Miscellaneous:Other. Seems like I wouldn't want to spend much more time thinking about it. "Brent" <HarvestThis@Spammers.Net> wrote in message news:ONbDcEZeHHA.596@TK2MSFTNGP06.phx.gbl... > How have others who have lost loved ones categorized their final expenses > (casket, funeral, plot, monument, etc.)? In microsoft.public.money, Dick Watson wrote: >Never done it. I'm thinking Miscellaneous:Other...

Division and formatting excel question
I am doing a spread sheet right now and I am not having good luck with a certain function I need to do. What it is, I need a number, say 55,104 divided by 1,440 which equals 38.266666 . I would like it to only display 38.26 in the cell. I did a format cell and show 2 decimal places but it doesnt do it. Then I need to add up the results of 5 cells of the same kind as previously mentioned. When I try to add them up now it just shows 0.00 using the sum function? I dont get what I need to do different. What it is, is a production sheet, we produced 55104 gallons of product i...

Iffunction questions pulling values from other sheets +return value from partial data
I have been struggling with the IF Function for a while, what I a trying to accomplish is this: Let's say the data in cell A1 depends on part of the data in cell B1. need the function to bring up a value in A1 (for this example we'll us Nelson Rains) ONLY IF the first two letters in Cell B1 are NR. So basically if I enter "NR430" in cell "B1" then cell A1 will displa "Nelson Rains". Can this be Done? +--------------------------------------------------+ Another matter (albeit less pressing) I would like help on is whethe or not an IF Function can pull...

Validation question in 2007
If I click on Col B I and select DATA/ Validation I get the message:The selection contains more than one type of validation. Erase current and continue?" My question is: How can I find out what data validation are currently in use. Thanks Hi, You can use Goto Special cells . CTRL+G displays dialog Special... Check Data validation. You can then select all cells with data validation or this with the same data validation as the activecell. Cheers Andy pcor wrote: > If I click on Col B I and select DATA/ Validation I get the message:The > selection contains more than one type...

A Question about CTreeCntrl
I'm writing an application from an example that uses a CTreeCtrl. I'm don't understand the usage of the InsertItem methods and its parameters. HTREEITEM InsertItem( LPTVINSERTSTRUCT lpInsertStruct ); HTREEITEM InsertItem( UINT nMask, LPCTSTR lpszItem, int nImage, int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam, HTREEITEM hParent, HTREEITEM hInsertAfter ); HTREEITEM InsertItem( LPCTSTR lpszItem, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST ); HTREEITEM InsertItem( LPCTSTR lpszItem, int nImage, int nS...

Question on "Monthly Income and Expenses" report
I decided I wanted to generate a quarterly report by category showing monthly income and expenses. I was able to get it to work, but try as I might, I can not find a way to show transfers from my checking account to my savings account. I know that I do not want to show transfers to the credit card account. But the choices on the show transfers does not result in the transfers to savings or the purchase of CD's as showing up in the report. I am running Money Plus Delux. Without chasing the specifics just yet, understand that "Income and Expenses" are everything Transfe...

Question about WM_SIZEPARENT
I have a CWnd derived class which is in control of some tabbed CView objects. The first view which is AFX_IDW_PANE_FIRST controls sizing of the views when it receives the WM_SIZEPARENT message. The problem is that it doesn't always get the message. I've traced into CWnd::RepositionBars(...) and found the following code: for (HWND hWndChild = ::GetTopWindow(m_hWnd); hWndChild != NULL; hWndChild = ::GetNextWindow(hWndChild, GW_HWNDNEXT)) { UINT nIDC = _AfxGetDlgCtrlID(hWndChild); CWnd* pWnd = CWnd::FromHandlePermanent(hWndChild); if (nIDC == nIDLeftOver) hWndLeftOver = hWnd...

2 more questions
First of all thanks to all of you who helped me with my workbook. I have 2 more questions to ask: 1. cell F2 has a SUM formula. I would like the formula to go automatically to F3 but this ONLY if A3 is not empty and to F4 if A4 is not empty and so on. Is it possible? 2. at the end of the day all data inserted in Sheet 1 go automatically to a hidden sheet and is deleted from sheet 1. is it possible to create a macro or whatever which can restore the SUM formula in F2 etc (as above)? Thanks again for your help Try this in F2: =IF(A2<>0,SUM(A2:E2),"") And drag down to...

CRM3.0 Question on Activity
Hello, I am using CRM3.0. I have the following case. 1. Create Campaign 2. Add contact to campaign list 3. Create Campaign activity - Phone call 4. Distribute activity 5. CRM User will make phone call 6. When contact is interest, CRM user will make a "Free Trail" for contact. I am having troble in step 6. So far as I know, I have two choices for "Free Trail". A) Service Activity If I choose to create a service activity, then I can not link up the service activity with the campaign or phone call. B) Appointment If I choose appointment, I can set "regarding"...

Moving mailbox question
I am moving mailboxes between exchange 5.5 to Exchange 2003. I've noticed after the move, in Exchange 5.5, the mailbox still exist. Shouldn't the mailbox be deleted or removed from exchange 5.5? Thanks how, exactly, are you moving them? -- Susan Conkey [MVP] "sean" <nosean@noemail.gmail.com> wrote in message news:Orrizb8FHHA.5000@TK2MSFTNGP03.phx.gbl... >I am moving mailboxes between exchange 5.5 to Exchange 2003. I've noticed >after the move, in Exchange 5.5, the mailbox still exist. Shouldn't the >mailbox be deleted or removed from e...

File Share Witness
Please help me understand something - I think I get the concept of using a file share witness in CCR, however, I have read that it is suggested that this server also be a Hub Transport Server. How can this be if a Hub Server is not cluster aware? Isn't the file share witness server configured to be part of the cluster? On Jan 31, 12:25 pm, PM <P...@discussions.microsoft.com> wrote: > Please help me understand something - I think I get the concept of using a > file share witness in CCR, however, I have read that it is suggested that > this server also be a Hub Transpor...

Recovery Partition Question
A friend had a system crash and resinstalled windows 7 using the factory disk. They selected the option to create a recovery partition. All was well but they were not paying attention after it was created and when they went to install programs and save programs they saved and installed them on the recovery partition. It is now almost full. Can he remove or delete files he does not need ? If so what should remain? Also is there a way to block this from happening in the future. Thanks Nash55 ...