[AccessD] Films and photos...

Stuart McLachlan stuart at lexacorp.com.pg
Tue Nov 15 05:19:44 CST 2016


Thuinking about it, in the After-Update, you still have the value of PictureName, so you can 
simplify it to one line:

NextPictureName = Left$(PictureName,5) & _
 Format(Val(mid$(PictureName,6) +1),"00")



On 15 Nov 2016 at 12:30, Kostas Konstantinidis wrote:

> Hi Stuart,
> Thank's for your reply 
> The first works perfect, but I can't make the second to work. 
> 
> /kostas
> 
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf
> Of Stuart McLachlan Sent: Tuesday, November 15, 2016 12:56 AM To:
> Access Developers discussion and problem solving
> <accessd at databaseadvisors.com> Subject: Re: [AccessD] Films and
> photos...
> 
> Of the top of my head:
> 
> 1.
> IF VAL(PictureName) <> IdFilms then
> Msgbox "Incorrect Picture ID"
> END IF
>  'Val will return everything up to the first non numeric character
>  'i.e.
> Val("9999_01") will return 9999.
> 
> 2. 
> LastPictureName  = DMax("PictureName","tblPictures", _ "PictureName
> like '" & Left$(PictureName,4) & "*'"
> 
> LastPictureID = val(right$(LastPictureName,2))
> 
> NextPictureName = Left$(LastPictureName,5) & Format(LastPictureID +
> 1,"00")
> 
> --
> Stuart
> 
> 
> On 14 Nov 2016 at 21:53, Kostas Konstantinidis wrote:
> 
> > hi all,
> > Into a simple subform I keep photos of various films
> > IdFilms (long Integer) e.g. 9999
> > PhotoType (Short Text) which contains the words Poster or Shooting
> > Photo or Film Photo PictureName (Short Text) like 9999_01 to 9999_xx
> > 
> > What I need is:
> > 1. "after PictureName update" to check if it begins with wrong
> > IdFilms, getting a warning message 2. If it's possible "after update
> > PhotoType" to get automatically the next PictureName e.g. 9999_02
> > 
> > 
> > thank's
> > /kostas
> > 
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list