0 Then Msgbox "La priorita ufficio deve essere un multiplo di 5" continue = False Exit Sub End If 'Blocca duplicazione priorità per ufficio If uff = "Acquisti" Then Set view = db.GetView( "visacq" ) Elseif uff = "Centralino" Then Set view = db.GetView( "viscen" ) Elseif uff = "Centralino" Then Set view = db.GetView( "viscen" ) Elseif uff = "Contabilità" Then Set view = db.GetView( "viscon" ) Elseif uff = "Domino" Then Set view = db.GetView( "visdom" ) Elseif uff = "Edp" Then Set view = db.GetView( "visedp" ) Elseif uff = "Imballo attrezzi" Then Set view = db.GetView( "visiat" ) Elseif uff = "Magazzino grezzo" Then Set view = db.GetView( "vismnu" ) Elseif uff = "Personale" Then Set view = db.GetView( "visper" ) Elseif uff = "Produzione Generale" Then Set view = db.GetView( "vispge" ) Elseif uff = "Qualità" Then Set view = db.GetView( "visqua" ) Elseif uff = "Ricevimento" Then Set view = db.GetView( "visric" ) Elseif uff = "Spedizioni" Then Set view = db.GetView( "visspe" ) Elseif uff = "Tecnico" Then Set view = db.GetView( "vistec" ) Elseif uff = "Vendite" Then Set view = db.GetView( "visven" ) End If 'Cerco nella vista dell'uffici un documento con la stessa priorità Set doc = view.GetDocumentByKey(prior_doc) 'Non trovo documenti nella vista per ufficio con la stessa priorità, proseguo con il salvataggio If doc Is Nothing Then continue = True Else 'Sto salvando un nuovo documento e trovo altri documenti nella vista per ufficio con la stessa priorità, 'blocco il salvataggio If curdoc.IsNewNote Then Msgbox "Priorità già presente per l'ufficio indicato" continue = False Exit Sub 'Sto variando un documento esistente controllo che la priorità del documento 'che sto salvando non sia già presente in un altro documento della vista dell'ufficio 'del nuovo documento, non considerando il documento che sto salvando Else While Not ( doc Is Nothing ) If doc.universalid <> curdoc.universalid Then Msgbox "Priorità già presente per l'ufficio indicato" continue = False Exit Sub End If Set doc = view.GetNextDocument(doc) prior_view = doc.priuffn(0) If prior_view <> prior_doc Then Exit Sub End If Wend End If End If End If End Sub">