If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Checking the deadline
I have a form (based on table batches) and subform (based on table ads) and I
need that when i enter a new ad on the system it checks on another table (deadlines) if the ad is not late. The deadlines table has 2 rows, section and deadline (as each section has it's own deadline) Can you help me? |
#2
|
|||
|
|||
Checking the deadline
Hello,
one option could be use function Dlookup. Private Sub fldNewAd_BeforeUpdate(Cancel As Integer) strResult = DLookup("deadline", "tbldeadline", "[section]=[fldNewAd]") If IsNull(strResult) Then MsgBox "NoValue" Else: MsgBox (strResult) End If End Sub "Vin Antonello" wrote: I have a form (based on table batches) and subform (based on table ads) and I need that when i enter a new ad on the system it checks on another table (deadlines) if the ad is not late. The deadlines table has 2 rows, section and deadline (as each section has it's own deadline) Can you help me? |
#3
|
|||
|
|||
Checking the deadline
Thanks Stefan! That worked, i'm seeing the msgbox, but I still need some help
I have four deadlines, Thursday, Friday, Monday11 and Monday15 I need a code to check if the ad was batched after the deadline (the batches are only booked on thurday, friday and monday and the last batching day is monday). something like if deadline = monday15 and today=monday and time15:00 then "late" else "ok" if deadline = monday11 and today=monday and time11:00 then "late" else "ok" if deadline = friday and today=monday then "late" elseif deadline =friday and today=friday and time15 then "late" else "ok" if deadline =thursday and today thursday then "late" elseif deadline = thursday and today=thursday and time15 then "late" I know i can do this with a case, but I dont know how! "Stefan_889_12" wrote: Hello, one option could be use function Dlookup. Private Sub fldNewAd_BeforeUpdate(Cancel As Integer) strResult = DLookup("deadline", "tbldeadline", "[section]=[fldNewAd]") If IsNull(strResult) Then MsgBox "NoValue" Else: MsgBox (strResult) End If End Sub "Vin Antonello" wrote: I have a form (based on table batches) and subform (based on table ads) and I need that when i enter a new ad on the system it checks on another table (deadlines) if the ad is not late. The deadlines table has 2 rows, section and deadline (as each section has it's own deadline) Can you help me? |
Thread Tools | |
Display Modes | |
|
|