Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

ya t'il 1 moyen d'ecrire une table en vba ou macro

1 réponse
Avatar
yann
bonjour

voila mon probléme j'ais 1 table avec X enregistrement sur 1 seule collonne
ex:

col1
ligne1 a.jpg
ligne2 b.jpg
ligne3 c.jpg

je voudrais cree 1 autre table avec celci mais qui soie tailler differament
ex:


col1 col2 col3 .....
ligne1 a.jpg b.jpg c.jpg


jais un bou de code mais il marche a moitier quelqu'un pourrais m'aider.
merci

'debut du code******************************
Function prod__________()
On Error GoTo prod___________Err

Dim intX As Integer, intZ As Integer
Dim VAL As String
VAL = DCount("nomimage1", "defimg")
For intX = 1 To VAL
For intZ = 1 To VAL
DoEvents

Next intZ
DoCmd.OpenTable "defimg", acViewNormal, acReadOnly
DoCmd.FindRecord "*", acEntire, False, , False, acCurrent, True
DoCmd.RunCommand acCmdCopy
DoCmd.OpenTable "Table1", acViewNormal, acAdd
DoCmd.RunCommand acCmdPaste
DoCmd.RunCommand acCmdInsertTableColumn
DoCmd.OpenTable "defimg", acViewNormal, acReadOnly
DoCmd.FindNext
DoCmd.RunCommand acCmdCopy
DoCmd.OpenTable "Table1", acViewNormal, acAdd
DoCmd.RunCommand acCmdPaste
Next intX

prod___________Exit:
Exit Function

prod___________Err:
MsgBox Error$
Resume prod___________Exit

End Function

'fin du code ***********************

1 réponse

Avatar
yann
voila ji suis arrive quand mem

On Error Resume Next
Dim CtlImg As Control
Dim intX As Integer, intZ As Integer
Dim VAL As String
DoCmd.OpenForm "formulaire1", acDesign
VAL = DCount("nomimage1", "||||||||||||||||||||")
For intX = 1 To VAL
For intZ = 1 To VAL
DoEvents
Next intZ
Set CtlImg = CreateControl("Formulaire1", acImage, , , , 200, 50, 1000,
1000)
DoCmd.OpenTable "||||||||||||||||||||"
DoCmd.RunCommand acCmdCopy
DoCmd.FindNext
DoCmd.OpenTable "Table1"
DoCmd.RunCommand acCmdInsertTableColumn
DoCmd.RunCommand acCmdPaste
Next intX

par contre je n'arrive pas a replacer les controls d' images dans mon
formulair
il sont les un dessus les autres de l'aide :-(

Merci
"yann" a écrit dans le message de
news:40b1be9c$0$16696$
bonjour

voila mon probléme j'ais 1 table avec X enregistrement sur 1 seule
collonne

ex:

col1
ligne1 a.jpg
ligne2 b.jpg
ligne3 c.jpg

je voudrais cree 1 autre table avec celci mais qui soie tailler
differament

ex:


col1 col2 col3 .....
ligne1 a.jpg b.jpg c.jpg


jais un bou de code mais il marche a moitier quelqu'un pourrais m'aider.
merci

'debut du code******************************
Function prod__________()
On Error GoTo prod___________Err

Dim intX As Integer, intZ As Integer
Dim VAL As String
VAL = DCount("nomimage1", "defimg")
For intX = 1 To VAL
For intZ = 1 To VAL
DoEvents

Next intZ
DoCmd.OpenTable "defimg", acViewNormal, acReadOnly
DoCmd.FindRecord "*", acEntire, False, , False, acCurrent, True
DoCmd.RunCommand acCmdCopy
DoCmd.OpenTable "Table1", acViewNormal, acAdd
DoCmd.RunCommand acCmdPaste
DoCmd.RunCommand acCmdInsertTableColumn
DoCmd.OpenTable "defimg", acViewNormal, acReadOnly
DoCmd.FindNext
DoCmd.RunCommand acCmdCopy
DoCmd.OpenTable "Table1", acViewNormal, acAdd
DoCmd.RunCommand acCmdPaste
Next intX

prod___________Exit:
Exit Function

prod___________Err:
MsgBox Error$
Resume prod___________Exit

End Function

'fin du code ***********************