Bjr a tous
Débutant en developpement
Voici le code que j'utilise pour dupliquer une ligne dans ma base access 2003.
Jusque la pas de probleme.
Voila je souhaite dupliquer les enregistrements de mon Formulaire continu en fonction de "quantiteColis".
C'est a dire que:
- si quantiteColis = 2 que le programme duplique l'enregistrement (la ligne) en question 2fois.
- si quantiteColis = 5 que le programme duplique l'enregistrement (la ligne) en question 5fois
- si quantiteColis = n que le programme duplique l'enregistrement (la ligne) en question "n" fois
- .............. Ainsi de suite
Le but est de pouvoir imprimer autant d'étiquettes que de lignes
Voici le code que j'utilise pour dupliquer l'enregistrement une fois.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="ProgId" content="Word.Document" /><meta name="Generator" content="Microsoft Word 11" /><meta name="Originator" content="Microsoft Word 11" /><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5COK%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]--><style><!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
--></style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->Private Sub
Form_DblClick(Cancel As Integer)
Dim dbs As
DAO.Database, Rst As DAO.Recordset
Dim F As
Form
' Return
Database variable pointing to current database.
Set dbs =
CurrentDb
Set Rst =
Me.RecordsetClone
On Error
GoTo Err_DblClick_Click
Reponse = MsgBox("Voulez-vous dupliquer l'étiquette de
ce colis ?", vbYesNo, "Duplication")
If Reponse = vbYes Then
' Tag
property to be used later by the append query.
Me.Tag =
Me![etiquettetableID]
' Add new
record to end of Recordset object.
With Rst
.AddNew
!QuantiteColis =
Me!QuantiteColis
!NCOMMANDE =
Me!NCOMMANDE
!LibelleColis =
Me!LibelleColis
!libelleClient =
Me!libelleClient
!codeColis =
Me!codeColis
.Update ' Save changes.
.Move
0, .LastModified
End With
Me.Bookmark
= Rst.Bookmark
Me.Refresh
End If
Exit_DblClick_Click:
Exit Sub
et voici ma table:
<col style=\"width: 76pt;\" width=\"101\" /><col style=\"width: 68pt;\" width=\"91\" /><col style=\"width: 220pt;\" width=\"293\" /><col style=\"width: 86pt;\" width=\"114\" /><col style=\"width: 76pt;\" width=\"101\" /><col style=\"width: 59pt;\" width=\"79\" />----
etiquettetableID, Client, LibelleColis, NCOMMANDE, QuantiteColis, codeColis, ----
223, PENJA, Colis 200 calathea white star pm, 3236
ORCHI, 60, EC, ----
238, PENJA, Monstera
PM, 3236
A, 8, AP, ----
239, PENJA, Monstera
Mini, 3236
A, 10, AQ, ----
240, PENJA, Monstera Ultra Mini, 3236
A, 10, AR, ----
244, PENJA, Colis 150 Calathea white st GM, 3236
A, 10, EB, ----
245, PENJA, Colis 200 calathea white star pm, 3236
A, 15, EC, ----
249, PENJA, Colis de 150 Curculigo GM, 3236
A, 100, EQ, ----
250, PENJA, Colis de 5 Ronier rouge GM, 3236
A, 10, ET, ----
251, PENJA, Colis de 5 Ronier rouge MM, 3236
A, 10, EU, ----
252, PENJA, Colis de 20 Ronier rouge PM, 3236
A, 0, EV, ----
256, PENJA, Colis de 30 Carludovica, 3236
A, 4, FN, ----
260, PENJA, Colis de 50 Têtes
Cordyline White edge large, 3236
A, 8, HC, ----
262, PENJA, Colis de 50 Têtes cordyline
Albert, 3236
A, 8, HL, ----
264, PENJA, Colis de 150 Drac Fragrans, 3236
A, 10, IL, ----
267, PENJA, Colis 100 Pandanus Vert GM, 3236
A, 30, KA, ----
268, PENJA, Colis de 100 Pandanus panaché GM, 3236
A, 30, KG, ----
275, PENJA, Colis 50 Tête Pandanus panache
Mini, 3236
A, 10, KV, ----
279, PENJA, Cucumis (panier de 24), 3236
A, 0, GC, ----
283, PENJA, Ananas panache PM, 3236
A, 4, NG, ----
284, PENJA, Ananas panache Mini, 3236
A, 6, NH, ----
285, PENJA, Sachet 1 kg Mignonette, 3236
A, 10, OA, ----
14941, PENJA, Bqt Rond Carludovica, 3372
B, 5, WM, ----
14943, PENJA, Bqt
Rond / 15, 3372
B, 3, ZV, ----
14946, PENJA, Bqt BORA BORA /6, 3372
B, 3, ZD, ----
14949, PENJA, Plaque tronc Claire, 3372
B, 10, OJ
Help please
Merci
JESSENIERIN
Afficher la suite