Kamis, 03 Mei 2012

RE: [MS_AccessPros] Re: embedded macros

 

Phil-

What I would do is insert another ElseIf and copy the arguments from the If. Then change the If to the new test you want.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

--------------------

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Phil Knowles
Sent: Thursday, May 03, 2012 10:46 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Re: embedded macros

Hi Bill

No. If I delete the IF, it deletes the whole block of logic that goes with it and that is what I want to retain.

Not to worry - it looks like I'll have to start over - I just thought there may be something simple I was missing

thanks for your help

Phil





________________________________
From: Bill Mosca <wrmosca@comcast.net>
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, 2 May 2012, 21:11
Subject: [MS_AccessPros] Re: embedded macros

Phil

Can you delete the bad IF and then add a new ELSEIF?

Bill

--- In MS_Access_Professionals@yahoogroups.com, Phil Knowles <pdk444444@...> wrote:
>
> 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@...>
> 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]
>

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

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar