Receive all check boxes with dates if null

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

Guest

Hi I have a main form orders and a sub form Order Details. I found this on
the forum and addapted it to work with mine.
In the event that a command button is pressed (on click) it runs the
procedure below and it sets all the values of the Goods Received check boxes
to True if they are False.
However the date to return seems to either not return a date or overwrite
previous dates depending if Null is put in place of the ????. If the field is
null I want it to return todays date, however ignore it if there is already a
date in there.

Private Sub AllGoodsReceived_Click()
With [Forms]![OrdersToshiba]![OrderDetails].[Form].RecordsetClone
.MoveFirst
Do While .EOF = False
.Edit
If ![GoodsReceived] = False Then ![GoodsReceived] = True Else
![GoodsReceived] = True
If ![GoodsReceivedDate] = ???? Then ![GoodsReceivedDate] = Date
Else ![GoodsReceivedDate] = date
.Update
.MoveNext
Loop
End With
End Sub

Can some one help me sort out the criteria?

Thanks

Andi
 
Solved it with this line...

If ![GoodsReceivedDate] <> Date Then ![GoodsReceivedDate] =
![GoodsReceivedDate] Else ![GoodsReceivedDate] = Date

I always do this. It's Murphys Law. As soon as i post a question Murphys Law
says I will figure out an answer in the next five minutes.

Murphy's law (Ml) can be can be calculated as

Answer (A) = Ml* Posting Question (Pq) / Time (T)

A=ML*Pq/T

So my whole calculation looks like this if this is any help to anybody?

Thanks - Andi Lee Davis


Private Sub AllGoodsReceived_Click()
With [Forms]![OrdersToshiba]![OrderDetails].[Form].RecordsetClone
.MoveFirst
Do While .EOF = False
.Edit
If ![GoodsReceived] = False Then ![GoodsReceived] = True Else
![GoodsReceived] = True
If ![GoodsReceivedDate] <> Date Then ![GoodsReceivedDate] =
![GoodsReceivedDate] Else ![GoodsReceivedDate] = Date
.Update
.MoveNext
Loop
End With
End Sub
 
Back
Top