Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Holding the Filename in the Loadpicture

Status
Not open for further replies.

bbrendan

IS-IT--Management
Dec 13, 2001
109
GB
Hi,

Im just needing some help in storing the variable "picfile". The problem is each time I loop through the recordset it resets the "picfile" variable. But I would like to save this!
Im thinking a for/next loop or an array??. But Any help would be very appreciated!!

-----------------------------------------------------------
Dim Batch_ID As Double
Dim txtRange As String

picFile = App.Path & "\image\"

Do Until crORS.EOF

Call GetPic(txtRange, crORS.Fields("Image_ID").Value, crORS.Fields("Batch_ID").Value)

picFile = picFile & crORS.Fields("Batch_ID").Value & "_" & crORS.Fields("Image_ID").Value & ".jpg"

Set Picture2.FormattedPicture = LoadPicture(picFile) ' This PicFile needs to be stored as I loop through the recordset

crORS.MoveNext

Loop

-----------------------------------------------------------

thanks
brendan
 
If you mean stored while the module is in existence then use an array. You'll need to declare it as a dynamic array, and redim it each run through the loop. It's all explained well in VBHelp under ReDim Statement.

If you're looking for permanent storage you'll do better with a textfile

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top