VB Code on Event

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

Guest

Good Morning..

I was lucky to get some help yesterday but I am stuck again. I added in
another function that I did not anticipate when my question was initially
answered. People seem to want the moon and stars these days.

I have an event that will be triggered when it finds a user added to the
database that resides on a second table. However, I need to have the message
box tripped off if the Event Type on my entry form matches 3 different
events. Those events are: Sick, Personal Day & Sick- Used Vacation

I got it working on a single event yesterday with the following code:

If DCount("*", "Switchboard", "[Associate Name] = """ & Me![Associate Name]
& """") > 0 And Me![Event Type] = "Sick" Then
MsgBox "The agent entered is Switchboard coverage. Please advise Linda
of the absence."

I have been driving myself crazy trying to figure out what code to use to
make it look at multiple items.

Help please before I go postal w/ my hockey stick..

Thanks,
Jim
 
That Crazy Hockey Dood said:
Good Morning..

I was lucky to get some help yesterday but I am stuck again. I added in
another function that I did not anticipate when my question was initially
answered. People seem to want the moon and stars these days.

I have an event that will be triggered when it finds a user added to the
database that resides on a second table. However, I need to have the
message
box tripped off if the Event Type on my entry form matches 3 different
events. Those events are: Sick, Personal Day & Sick- Used Vacation

I got it working on a single event yesterday with the following code:

If DCount("*", "Switchboard", "[Associate Name] = """ & Me![Associate
Name]
& """") > 0 And Me![Event Type] = "Sick" Then
MsgBox "The agent entered is Switchboard coverage. Please advise Linda
of the absence."

I have been driving myself crazy trying to figure out what code to use to
make it look at multiple items.

Help please before I go postal w/ my hockey stick..

Thanks,
Jim

How about:

If DCount(...) > 0 And ((Me![Event Type] = "Sick") Or (Me![Event Type] =
"Personal Day") Or (Me![Event Type] = "Sick-Used Vacation")) Then ...


Carl Rapson
 
Carl...

I could kiss you. Well.. Not really but it worked like a charm. That was
the only way of writing the code that I did not try and probably would not
have since I was so frustrated. I am attempting to teach myself VB and
everything else while working on this project and it shows at times.

You guys have been tons of help in the last 24 hours.

Thanks again,
Jim
--
"Baliff. Whack him in the pee-pee!"
"How come his is so much bigger then yours?"
"I am not even suppose to be here today!"


Carl Rapson said:
That Crazy Hockey Dood said:
Good Morning..

I was lucky to get some help yesterday but I am stuck again. I added in
another function that I did not anticipate when my question was initially
answered. People seem to want the moon and stars these days.

I have an event that will be triggered when it finds a user added to the
database that resides on a second table. However, I need to have the
message
box tripped off if the Event Type on my entry form matches 3 different
events. Those events are: Sick, Personal Day & Sick- Used Vacation

I got it working on a single event yesterday with the following code:

If DCount("*", "Switchboard", "[Associate Name] = """ & Me![Associate
Name]
& """") > 0 And Me![Event Type] = "Sick" Then
MsgBox "The agent entered is Switchboard coverage. Please advise Linda
of the absence."

I have been driving myself crazy trying to figure out what code to use to
make it look at multiple items.

Help please before I go postal w/ my hockey stick..

Thanks,
Jim

How about:

If DCount(...) > 0 And ((Me![Event Type] = "Sick") Or (Me![Event Type] =
"Personal Day") Or (Me![Event Type] = "Sick-Used Vacation")) Then ...


Carl Rapson
 
I am just jumping in here with a completely different problem. My old VB 6.0
was working very nicely for me, I had got used to it in other words. Now,
because it won't work with Windows Vista I have had to go an buy the latest
version.
Consequently I cannot get started in anything but simple forms design,
because of the way MS has redesigned the Database query and handling parts of
the system.
I cannot understand the names they use, everything is different. All I was
trying to do was create a form with access to an access db which would allow
me to cycle through the records like the ADODC controls would.
Any suggestions out there?

Carl Rapson said:
That Crazy Hockey Dood said:
Good Morning..

I was lucky to get some help yesterday but I am stuck again. I added in
another function that I did not anticipate when my question was initially
answered. People seem to want the moon and stars these days.

I have an event that will be triggered when it finds a user added to the
database that resides on a second table. However, I need to have the
message
box tripped off if the Event Type on my entry form matches 3 different
events. Those events are: Sick, Personal Day & Sick- Used Vacation

I got it working on a single event yesterday with the following code:

If DCount("*", "Switchboard", "[Associate Name] = """ & Me![Associate
Name]
& """") > 0 And Me![Event Type] = "Sick" Then
MsgBox "The agent entered is Switchboard coverage. Please advise Linda
of the absence."

I have been driving myself crazy trying to figure out what code to use to
make it look at multiple items.

Help please before I go postal w/ my hockey stick..

Thanks,
Jim

How about:

If DCount(...) > 0 And ((Me![Event Type] = "Sick") Or (Me![Event Type] =
"Personal Day") Or (Me![Event Type] = "Sick-Used Vacation")) Then ...


Carl Rapson
 
Back
Top