Horse flu makes horse a bit hoarse :-o
It is a bloody disaster in NSW (and Southern Qld.)
J
| 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
|
| | > 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
| >
| >
| >
| > | > |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
| > |
| > |
| > | | > | > 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
| > | >
| > | > | > | >>
| > | >>
| > | >> Hi Bob,
| > | >>
| > | >> Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _
| > | >> Format(Date,"dd/mm/yy"),tbDayNo)
| > | >>
| > | >> Regards
| > | >> Jacob
| > | >>
| > | >>
| > | >>
| > | >> | > | >> |
| > | >> | 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
| > | >> |
| > | >> |
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
|