m-taha
New member
- Local time
- Today, 01:57
- Joined
- Dec 6, 2019
- Messages
- 29
hi i'm Mathani
i'm not very well aversed with VBA i only started two moth ago, so i need help!
i have a code(in a standard module) where i would like it to generalize the name of the picture in a report (image control name) and the name of the report that i'm refering to , because i want to use it on other reports with image controls as well, instead chnging the names everytime i use it on a different report .
this is my code :
note : (pfad = path) , (bericht = report) , (bild = picture/image)
Dim pfad As String
Dim Bild As Access.image
Dim Bericht As Access.Report
Set Bild127 = Bild
Set Bericht1 = Bericht
pfad = "C:\Entwicklung\Mathani\QR_PIC\" & filename & ".png"
Reports!Bericht1.Bild127.Picture = pfad
i know my code is Wrong hhhhh, well that's why i'm here, so when i run this it gives me the error message ( Runtime Error 2451 : The Bericht1 that you entered is either misspelled or refers to a report that is not open or does not exist). And for the picture sometimes i get a message 424 that object necessary.
Thank you so much in advance ❤☺
i am open to any suggestions that would make the code better/more efficient/easier anything literally anything
i'm not very well aversed with VBA i only started two moth ago, so i need help!
i have a code(in a standard module) where i would like it to generalize the name of the picture in a report (image control name) and the name of the report that i'm refering to , because i want to use it on other reports with image controls as well, instead chnging the names everytime i use it on a different report .
this is my code :
note : (pfad = path) , (bericht = report) , (bild = picture/image)
Dim pfad As String
Dim Bild As Access.image
Dim Bericht As Access.Report
Set Bild127 = Bild
Set Bericht1 = Bericht
pfad = "C:\Entwicklung\Mathani\QR_PIC\" & filename & ".png"
Reports!Bericht1.Bild127.Picture = pfad
i know my code is Wrong hhhhh, well that's why i'm here, so when i run this it gives me the error message ( Runtime Error 2451 : The Bericht1 that you entered is either misspelled or refers to a report that is not open or does not exist). And for the picture sometimes i get a message 424 that object necessary.
Thank you so much in advance ❤☺
i am open to any suggestions that would make the code better/more efficient/easier anything literally anything