Ciao,
in azienda era stato creato un software per un lavoro e poi è stato abbandonato,
avevo necessità di utilizzare uno strumento per aiutarmi con il magazzino e me lo sono personalizzato
un pò imparando ad utilizzare access da solo.
Il Database è diviso in FE e BE e viene usato con Access runtime perchè abbiamo solamente una licenza Access ed è condiviso in rete e risiede su un pc, lo utilizziamo io e 2 miei colleghi.
In sostanza esiste una tabella dove io inserisco tutto il materiale che possiede un serial number e gli altri 2 utenti
assegnano questi alcuni di questi seriali tramite una maschera che, legge da questa tabella e ne crea un'altra
creando una "commessa" che può contenere piu oggetti e seriali, questa tabella a sua volta ne genera un'altra identica
che serve come scambio.
Quando l'utente crea la commessa si creano dei campi dove andrà ad inserire i vari serialnumber dei componenti, quando si chiude la maschera la query
va a scrivere nelle 2 tabelelle, cancella tutti i campi che non sono stati compilati e li ricopia sull'altra.
Il problema che è sorto da un po di tempo è che dopo qualche inserimento il database si ingrandisce passa da 6/7 MB e può arrivare anche 1.7GB.
Non saprei dove e cosa modificare.
La query è stata scritta così:
Option Compare Database
Private Sub Form_Close()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateRemoveBlanks1"
DoCmd.OpenQuery "qryValidateToAssignementDetails1"
DoCmd.SetWarnings True
End Sub
Private Sub Form_Current()
Dim intMaxNumRecs As Integer
intMaxNumRecs = DLookup("[CountOfstrPartNumber]", "qryREC12SourceDataAssemblyPN", "[strAssemblyPartNumber]= TempVars!VarAssemblyPartNumber")
If Me.NewRecord Then
With Me.RecordsetClone
If .RecordCount > 0 Then
.MoveLast: .MoveFirst
If .RecordCount >= intMaxNumRecs Then
MsgBox "This Assembly has only " & intMaxNumRecs & " Serialized Components"
.MoveLast
Me.Requery
End If
End If
End With
End If
End Sub
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3201 Then
MsgBox "Il seriale che hai inserito non esiste, Verifica! The Serial Number of the Item you entered does not exist in the Database, please verify!"
Response = acDataErrContinue
ElseIf DataErr = 3022 Then
MsgBox "Il seriale che hai inserito è già stato assegnato ad un altro assieme Verifica! The Serial Number of the Item you entered is already assigned to an assembly, please verify!"
Response = acDataErrContinue
Else
MsgBox "Error No.:" & DataErr
End If
End Sub
Private Sub strCompnentLotNumber_LostFocus()
If IsNull(Me.strCompnentLotNumber) Then
Else
Me.strDateAssigned.Value = Me.Text21.Value
Me.strTechnicianName.Value = Me.Text23.Value
Me.strTimeAssigned.Value = Me.Text25.Value
End If
End Sub
Private Sub strComponentSerialNumber_LostFocus()
If IsNull(Me.strComponentSerialNumber) Then
Else
TempVars!VarComponentSerialNumber = Me.strComponentSerialNumber.Value
Dim v As String
v = DLookup("[strPartNumber]", "tblReceivingDetails", "strComponentSerialNumber = TempVars!VarComponentSerialNumber")
If v = strPartNumber Then
Me.strDateAssigned.Value = Me.Text21.Value
Me.strTechnicianName.Value = Me.Text23.Value
Me.strTimeAssigned.Value = Me.Text25.Value
DoCmd.RefreshRecord
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateAssignementStatus"
DoCmd.SetWarnings True
Else
MsgBox "Il partnumber associato al seriale inserito non corrisponde a quello che dovresti inserire, probabilmente non è stato trasformato!! The Part Number associated with the Serial Number you entered does not match the the Part Number on your
sheet, Please verify?"
DoCmd.Requery
End If
End If
End Sub