1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
'''
''' Edit the choosen incident
'''
Public Function EditThisexpense()
Dim dbs As Database
Dim rds As Recordset
Dim strSQL As String
Dim SQL As String
Dim frmcurrent As Form
Dim ctl As Control
Dim increment As Integer
'variable utilisé pour connaitre le numero de la ligne d'interet(y'en a 4 avec date pt/rec dans edt_incident)
increment = 1
''' Open the recordset
'strSQL = "SELECT *from te_frais where inc = " & incr & " and inc <>0;"
While increment <> 5
strSQL = "SELECT * from te_frais where inc = 1 and inc <>0;"
Set dbs = CurrentDb
Set rds = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
If rds.EOF And rds.BOF Then
rds.Close
Set rds = Nothing
dbs.Close
Set dbs = Nothing
MsgBox "Il n'ya plus de frais à envoyer.", vbApplicationModal + vbOKOnly + vbExclamation, "GED - Edition d'un dossier ef frais"
Exit Function
Else
MsgBox ("element trouvé")
'''Check if the incident still exists
'''Open the form
If FormIsOpen("inpfrais") Then
Forms("inpfrais").SetFocus
Else
DoCmd.OpenForm "inpfrais"
End If
''' Fill the form
rds.MoveFirst
With Forms("inpfrais")
.tbxNumeroDossier = ![IncidentRef]
.tbxContractNumber = ![ContractNumber]
.tbxNegociatedDate = ![NegociatedValueDate]
.tbxEffectiveDate = ![EffectiveValueDate]
.tbxFlowAmount = ![FlowAmount]
.cbxCurrency = ![FlowCurrency]
.cbxtdc = ![TDC]
.lblPayedReceived.Caption = IIf(rds![PayReceive] = "P", "Payé", "Reçu")
.cbxCounterpartyRef = ![CounterpartyRef]
.cbxProfitCentercdr = ![ProfitCentercdr]
.cbxProfitCenterbook = ![ProfitCenterbook]
End With
'''Close the instance
rds.Close
Set rds = Nothing
dbs.Close
Set dbs = Nothing
'''Fill the other part of the form
With Forms("inpfrais")
.tbxCounterpartyrlc.Requery
End With
Call Frm_inpfrais_cmdValidate_Click
End If
increment = increment + 1
Wend
End Function |
Partager