[AccessD] Films and photos...

Stuart McLachlan stuart at lexacorp.com.pg
Mon Nov 14 16:56:22 CST 2016


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
> 




More information about the AccessD mailing list