Re. After Insert event, previous post...

nicktheblue

Registered User.
Local time
Today, 06:40
Joined
Sep 15, 2001
Messages
18
You know how you get Access to do something smart, then realise that the solution is not quite as simple as you first thought (happens all the time with me, anyway)?
Well, after making Access fill in a field in a different table using After Update event on a form, it has become apparent that this needs to be conditional based upon the contents of another field on the form. The field in question is "JobType" which can be filled as "T", "M" or "P". What I need to tell access is that if "jobtype" <> "P", then run the code, else do nothing. Any suggestions? I am going to have a go myself, but I'm sure somebody 'out there' can save me a few hours work (it is FA cup day, y'know!).
Many thanks in advance,

Nick
 
Seeing as I'm working while hubby is watching the footie with you I'll see if I can help! I would use a select case to determine the type before proceding with the action:

Select Case Me.JobType

Case = "T"

'add your code to do whatever you want

Case = "M"

'add your code to do whatever you want

End Select

This works more efficiently than an If statement because it bounces from one case to the other and if it doesn't find a match it just keeps going.
 
Thanks for reply, DBL!

Ah, a Scotish person(?). Your hubby probably saw the better game. Me? I fell asleep. Still, it beats working. Many thanks once again!

Nick
 

Users who are viewing this thread

Back
Top Bottom