Populating Picture File names from a folder

david412

New member
Local time
Today, 14:56
Joined
Jan 12, 2006
Messages
8
I could realllllllly use some help here....

I have database that looks like this:

Type | Pic1 | Pic 2
-------------------------------------------
12-5525 C:\RC125525-01 C:\RC125525-02
12-3556 C:\RC123556-01 C:\RC123556-02

As you can see the picture naming system is standard and is based on the content in the type field. If one record of the Type field is say 12-6636 then the picture will be RC126636-01 (for Pic1) and RC126636-02.

Is there a way where the user say... can type C:\ and it will populate the picture file names in a combo box?

There are about 2000 records in the DB and I am just trying to find a way to keep a user from typing all that stuff.


:rolleyes: Could there be a way to do all 2000 records at once?...:rolleyes:
Thanks.
 
If you select "Yes" in "Auto Expand" of the combo box, it should take
you to the section where it matches the first character typed in. Your position in the combo box will change as you type more characters as it will try match the characters typed in.
 
edtab said:
If you select "Yes" in "Auto Expand" of the combo box, it should take
you to the section where it matches the first character typed in. Your position in the combo box will change as you type more characters as it will try match the characters typed in.

Thanks for the reply. But, I'm working with a table not a form. And to start with, I have not figured out how get the the file names to automatically show for each record in the table.
 
Solved

Problem solved.I got help from a friend. The code below is pretty self explanatory...

Code:
Option Compare Database
Function FilesandDetails()
On Error GoTo ErrorHandler

Dim rs As Recordset
Dim picdir As Variant
Dim CallQ As String

'The two lines of codes below call on an outside query

CallQ = "MyDB Query"
DoCmd.OpenQuery CallQ, acViewNormal, acEdit

Const sPath = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\"

Set rs = CurrentDb.OpenRecordset("MyDB")

picdir = Dir(sPath & "*.*")
Do Until picdir = ""
 
   rs.AddNew
    rs!FrontView = sPath & picdir
     rs!SideView = sPath & picdir
      rs!BackView = sPath & picdir
        rs.Update
                  
    picdir = Dir
Loop

rs.Close
Set rs = Nothing

Exit Function
DoCmd.Requery
  
ErrorHandler:

 MsgBox Err.Number & " : " & Err.Description

End Function
 

Users who are viewing this thread

Back
Top Bottom