If Me.Test = "LR" And Me.Time_Received >= #12:00:00 PM# And Me.Time_Received <= #7:00:00 PM# Then
Me.Date_Received = Me.Date_Received + 1
End If
If Me.Test = "LR" And Me.Time_Received >= #12:00:00 PM# And Me.Time_Received <= #7:00:00 PM# Then
Me.Date_Received = Me.Date_Received + 1
End If
It's already doing nothing. If you don't want it to do anything you don't need to write code for that. Both textboxes mus be bound to the fields.will add 1 day to date_received if the sample is received after noon, i am not sure how to code in:
if the sample is received before 11:59 AM, then "do nothing" or do not add 1 day to date_received. Thank you.
Wait until you get to your db. And again both textboxes mus be bound to the fields.I can not access the database from my cell phone so what is supposed to happen is when the HLA ID is filled in the date_received and time_received auto-fill. Then when the Test is selected the Due Date auto-fills based on the test.
If Me.test = "LR" And Me.Time_Received >= #12:00:00 PM# Then
Me.Date_Received = Me.Date_Received + 1
Me.Due_Date = Me.Due_Date + 1
End If
Yes I know but from previous responses I get the feeling the OP wants it stored that's why I didn't include an Else statement. If this isn't the case then of course an Else statement is required.@vbaInet
Actualy, no Due Date does not have to be bound to anything as it's a calaculation based on Date Received and is calculated by a Function. So, unless awake2424 wants to store a calculated value all is good there and it should be included in the lines of code.
Private Sub Test_AfterUpdate()
If Me.Test = "LR" And Me.Time_Received >= #12:00:00 PM# Then
Me.Date_Received = Me.Date_Received + 1
Me.Test.Requery
End If
So, if a sample was date_received 7/29/2014 at time_received 2:00 PM and Test "LR" would the new Due Date be 8/5/2014 because the new date_received is 7/30/2014? Thanks.