Rabu, 02 Mei 2012

Re: [MS_AccessPros] Re: embedded macros

 

Hi Clive
 
I did manage to insert the IF statement on the first line but my problem is with the second IF statement (originally the first IF statement) which I now need to be an ELSEIF.
 
I do intend to look into getting to grips with VBA - thanks for the links.
 
cheers
 
Phil
 


________________________________
From: Clive <zctek@aol.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, 2 May 2012, 19:48
Subject: [MS_AccessPros] Re: embedded macros


 

Hi Phil,

I take it that are not VBA user. VBA is not
all that difficult to get familiar with if
you have any programming experience. You will
be able to get plenty of assistance from the
group if you need it.
have a look at Crystal's site,
https://mvp.support.microsoft.com/profile=E1DA6AF8-CE8E-47E2-B2D4-A45FD93CE59B
and the link on it,
Learn VBA
http://www.AccessMVP.com/strive4peace/VBA

I am not a fan of Macros by the way but
to add a line at the beginning of your current
macro, just select the first line and Right_Click
on Insert a new row and put the new IF statment on
the first line. Don't forget to move the
MacroName(if any) from the old first line to
the new first line.

So you would end up with first two lines having
If statements. That is assuming the new line is
independant of what follows.

I will not be able to test your macro structure
on my machine because I do nat have Access2010
and I can do all I want with Access2007.

Hope that helps.

Regards, Clive.

--- In MS_Access_Professionals@yahoogroups.com, Phil Knowles <pdk444444@...> wrote:
>
> Hi Clive
>  
> It is access 2010 and yes it is an embedded macro created in the 'on exit' section of a field on a form.
>  
> It is quite simply a series of IF THEN  ELSEIFs designed to fill in values in other fields based on values in other fields on the same form.
>  
> eg (in simple form)
> IF field1 = x1 then field2 = y1
> ELSEIF field1 = x2 then field2 = y2
> ELSEIF field1 = x3 then field2 = y3
> ELSE field2 = y4
> ENDIF
>  
> It does what I want it to do so far and all I am trying to do now is add another IF statement at the start which I have managed to do but this requires me to change the current first IF into an ELSEIF which I haven't managed to do!
>  
> Also, it seems quite difficult - if not impossible - to copy and paste sections of the embedded macro.
>  
> Any ideas?
>  
> cheers
>  
> Phil
>  
>  
>  
>  
>
>
> ________________________________
> From: Clive <zctek@...>
> To: MS_Access_Professionals@yahoogroups.com
> Sent: Wednesday, 2 May 2012, 11:09
> Subject: [MS_AccessPros] Re: embedded macros
>
>
>
>  
>
> Hi Phil,
>
> What version of Access are you using?
>
> Do you really mean a Macro or is it VBA code?
> What did you use to create it?
>
> Please show us what you have got in your "macro"
> and what you want the macro to do.
>
> Regards, Clive
>
> --- In MS_Access_Professionals@yahoogroups.com, "pdk444444" <pdk444444@> wrote:
> >
> > Hi
> >
> > I have created an embedded macro in a form for the first time - basically a series of If / elseif commands.
> >
> > I am trying to add an outer if statement to the ones that are already there and then change the current 1st if to an elseif but I am having problems doing this.
> >
> > I have been able to add the outer (top) if statement but don't seem to be able to convert the next if to an elseif.
> >
> > help please!
> >
> > Phil
> >
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar