frequency field - grab DAY from computer

G

Guest

I have a frequency field for doing jobs. It show the day or days of the week
the job needs to be done. For example M or M, W or T or M, W, F. I could
be any combination with thursday being TH. When i click on a item(label) on
a given form I would like the form to open up the jobs forms for that
location(actually got that figured out) but want it to see what is the
Current DAY and show all jobs requierd for that day. What would the code be
for the On Click event to filter by current DAY and look for that day listed.

Thanks,
Barb
 
D

DanielS via AccessMonster.com

=IIf(Weekday([DateReceived])=1,"S",IIf(Weekday([DateReceived])=2,"M",IIf
(Weekday([DateReceived])=3,"T",IIf(Weekday([DateReceived])=4,"W",IIf(Weekday(
[DateReceived])=5,"TH",IIf(Weekday([DateReceived])=6,"F","SAT"))))))

DateReceived is the date field. Make an unbound field then replace
DateReceived with the field name you gave and give a shot.

Daniel
 
J

John W. Vinson

=IIf(Weekday([DateReceived])=1,"S",IIf(Weekday([DateReceived])=2,"M",IIf
(Weekday([DateReceived])=3,"T",IIf(Weekday([DateReceived])=4,"W",IIf(Weekday(
[DateReceived])=5,"TH",IIf(Weekday([DateReceived])=6,"F","SAT"))))))

Or more simply:

Choose(Weekday([DateReceived]), "SUN", "M", "TU", "W", "TH", "F",
"SAT")

John W. Vinson [MVP]
 
G

Guest

Thanks for your help,

Below is the code I have attached to the ON Click event of the label for a
given location(P1-1-Floor). I would like it to open the form frmalljobs with
all records due on the given DAY(today)Tues for that given location. Know I
need it to be AND but not sure the correct syntax???

Thanks,
Barb

Private Sub Label2_Click()
DoCmd.OpenForm "frmalljobs"
DoCmd.ApplyFilter , "location= 'P-1-1-Floor'And
IIf(Weekday([DateReceived])=1,"S",IIf(Weekday([DateReceived])=2,"M",IIf
Weekday([DateReceived])=3,"T",IIf(Weekday([DateReceived])=4,"W",IIf(Weekday(
[DateReceived])=5,"TH",IIf(Weekday([DateReceived])=6,"F","SAT"))))))"


John W. Vinson said:
=IIf(Weekday([DateReceived])=1,"S",IIf(Weekday([DateReceived])=2,"M",IIf
(Weekday([DateReceived])=3,"T",IIf(Weekday([DateReceived])=4,"W",IIf(Weekday(
[DateReceived])=5,"TH",IIf(Weekday([DateReceived])=6,"F","SAT"))))))

Or more simply:

Choose(Weekday([DateReceived]), "SUN", "M", "TU", "W", "TH", "F",
"SAT")

John W. Vinson [MVP]
 
G

Guest

I forgot to ask you about the daterecieved field. Do I need to have that it
my table behind the scenes of is that just the computer DATE????? Not sure
what I need to do with that field.

Thanks again,
BARb

John W. Vinson said:
=IIf(Weekday([DateReceived])=1,"S",IIf(Weekday([DateReceived])=2,"M",IIf
(Weekday([DateReceived])=3,"T",IIf(Weekday([DateReceived])=4,"W",IIf(Weekday(
[DateReceived])=5,"TH",IIf(Weekday([DateReceived])=6,"F","SAT"))))))

Or more simply:

Choose(Weekday([DateReceived]), "SUN", "M", "TU", "W", "TH", "F",
"SAT")

John W. Vinson [MVP]
 
J

John W. Vinson

I forgot to ask you about the daterecieved field. Do I need to have that it
my table behind the scenes of is that just the computer DATE????? Not sure
what I need to do with that field.

remember... we cannot see your database. We don't know (other than the
words that you post) what you're trying to accomplish.

If you just want the day letter for today's date, use Date() in place
of [datereceived]. I'm not sure what good that will do you, but that's
what you would do.

John W. Vinson [MVP]
 
D

DanielS via AccessMonster.com

I like the Choose function. Never used it before, will now.
Daniel
=IIf(Weekday([DateReceived])=1,"S",IIf(Weekday([DateReceived])=2,"M",IIf
(Weekday([DateReceived])=3,"T",IIf(Weekday([DateReceived])=4,"W",IIf(Weekday(
[DateReceived])=5,"TH",IIf(Weekday([DateReceived])=6,"F","SAT"))))))

Or more simply:

Choose(Weekday([DateReceived]), "SUN", "M", "TU", "W", "TH", "F",
"SAT")

John W. Vinson [MVP]
 
G

Guest

Thanks for your help! I attached the following to the ON Click event of an
Area of the Map of the Productions floor.
I would like it to oPen the form frmAllJobs - where the jobs have the given
location( since this is a map of ONLY the P-1-1-Floor I can easily just put
that criteria in.

I would also like it to grab an AREA of that location based on the area of
the map(label) that they click on- how can I put this Area for example -
Storage room in the criteria of records to pull up from that form.

Also got the DAY for Todays date automatically put in when the MAp is pulled
up. Want to also GRAB that?? for the criteria for jobs that need to be don
on TH for example. Some jobs have put in on the Alljobs table that they need
to be done only TH but some may be listed to be done on T, Th or any other
day(s) with Th.

Not sure how to grab these from the Map(form) and put them in the On Click
event for the Area of the Map that is clicked On.

Thanks so much for all of your help,
Barb

Private Sub Label2_Click()
DoCmd.OpenForm "frmalljobs"
DoCmd.ApplyFilter , "location= 'P-1-1-Floor'And [DayReceived]"

End Sub

John W. Vinson said:
I forgot to ask you about the daterecieved field. Do I need to have that it
my table behind the scenes of is that just the computer DATE????? Not sure
what I need to do with that field.

remember... we cannot see your database. We don't know (other than the
words that you post) what you're trying to accomplish.

If you just want the day letter for today's date, use Date() in place
of [datereceived]. I'm not sure what good that will do you, but that's
what you would do.

John W. Vinson [MVP]
 
J

John W. Vinson

Sorry, babs, I'm going out of town for over a week. I'm pretty perplexed by
your table structure. I'd suggest that you start a new thread and see if
someone else can help.

Apologies for leaving you hanging like that but I'm just out of time!
Thanks for your help! I attached the following to the ON Click event of an
Area of the Map of the Productions floor.
I would like it to oPen the form frmAllJobs - where the jobs have the given
location( since this is a map of ONLY the P-1-1-Floor I can easily just put
that criteria in.

I would also like it to grab an AREA of that location based on the area of
the map(label) that they click on- how can I put this Area for example -
Storage room in the criteria of records to pull up from that form.

Also got the DAY for Todays date automatically put in when the MAp is pulled
up. Want to also GRAB that?? for the criteria for jobs that need to be don
on TH for example. Some jobs have put in on the Alljobs table that they need
to be done only TH but some may be listed to be done on T, Th or any other
day(s) with Th.

Not sure how to grab these from the Map(form) and put them in the On Click
event for the Area of the Map that is clicked On.

Thanks so much for all of your help,
Barb

Private Sub Label2_Click()
DoCmd.OpenForm "frmalljobs"
DoCmd.ApplyFilter , "location= 'P-1-1-Floor'And [DayReceived]"

End Sub

John W. Vinson said:
I forgot to ask you about the daterecieved field. Do I need to have that it
my table behind the scenes of is that just the computer DATE????? Not sure
what I need to do with that field.

remember... we cannot see your database. We don't know (other than the
words that you post) what you're trying to accomplish.

If you just want the day letter for today's date, use Date() in place
of [datereceived]. I'm not sure what good that will do you, but that's
what you would do.

John W. Vinson [MVP]

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top