A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Checking the deadline



 
 
Thread Tools Display Modes
  #1  
Old February 16th, 2009, 11:08 AM posted to microsoft.public.access.gettingstarted
Vin Antonello[_2_]
external usenet poster
 
Posts: 9
Default 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  
Old February 16th, 2009, 12:33 PM posted to microsoft.public.access.gettingstarted
Stefan_889_12
external usenet poster
 
Posts: 14
Default 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  
Old February 20th, 2009, 11:26 AM posted to microsoft.public.access.gettingstarted
Vin Antonello[_2_]
external usenet poster
 
Posts: 9
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.