Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
I Didnt Really Learn Much
David Clement 
      
3 hours ago
Good Evening Richard,
As you may recall, I have been trying to put together a Photo Database for a while now. I have made a few different versions, but could not really get it to look like I wanted. I resorted to using chaGPT, the only problem is, I didn't learn much, because chapGPT just gave me the code to build a nice looking form. I would have much rather learned from you how to build one. You would have explained it as you went. Anyway, I've got a Photo Browser Form now.
I can share the form code if you like.
Trying to figure out how to send a screen shot, but something in the form wont let me do a a screen snip.
Anyway, thank you.
David Clement OP  @Reply  
      
3 hours ago
I guess the way the form was put together, you have just run the built in slideshow or exit the form. As I said, chatGPT gave me the code to do this.
I will share the code. It is actually pretty cool.

DetailsOption Compare Database
Option Explicit

Private PhotoList As Variant
Private PhotoCount As Long
Private CurrentPhoto As Long

Private Sub cboSpeed_AfterUpdate()

    Me.TimerInterval = CLng(Me.cboSpeed.Value) * 1000

End Sub

Private Sub cmdExit_Click()

    DoCmd.Close acForm, Me.Name

End Sub

Private Sub cmdNext_Click()

    ShowRandomPhoto

End Sub

Private Sub cmdPause_Click()

    If Me.TimerInterval > 0 Then

        Me.TimerInterval = 0
        Me.cmdPause.Caption = "Resume"

    Else

        Me.TimerInterval = CLng(Me.cboSpeed.Value) * 1000
        Me.cmdPause.Caption = "Pause"

    End If

End Sub

Private Sub LoadPhotoList()

    Dim rs As DAO.Recordset
    Dim i As Long
    Dim SelectedAlbum As Long

    SelectedAlbum = CLng(Me.OpenArgs)

    Set rs = CurrentDb.OpenRecordset( _
        "SELECT PhotoID, AlbumTitle, Description, PhotoFilePath " & _
        "FROM SlideShowT " & _
        "WHERE AlbumID = " & SelectedAlbum & _
        " ORDER BY PhotoID", dbOpenSnapshot)

    If rs.EOF Then
        PhotoCount = 0
        rs.Close
        Exit Sub
    End If

    rs.MoveLast
    PhotoCount = rs.RecordCount
    rs.MoveFirst

    ReDim PhotoList(1 To PhotoCount, 1 To 4)

    i = 1

    Do While Not rs.EOF

        PhotoList(i, 1) = rs!PhotoID
        PhotoList(i, 2) = Nz(rs!AlbumTitle, "")
        PhotoList(i, 3) = Nz(rs!Description, "")
        PhotoList(i, 4) = Nz(rs!PhotoFilePath, "")

        i = i + 1
        rs.MoveNext

    Loop

    rs.Close
    Set rs = Nothing

End Sub

Private Sub ShowRandomPhoto()

    Dim NewPhoto As Long
    Dim FileName As String

    If PhotoCount = 0 Then Exit Sub

    Do
        NewPhoto = Int(PhotoCount * Rnd) + 1
    Loop While PhotoCount > 1 And NewPhoto = CurrentPhoto

    CurrentPhoto = NewPhoto

    FileName = PhotoList(CurrentPhoto, 4)

    Me.txtTitle = PhotoList(CurrentPhoto, 2)
    Me.txtDescription = PhotoList(CurrentPhoto, 3)

    If Len(FileName) > 0 And Len(Dir(FileName)) > 0 Then
        Me.PhotoImage.Picture = FileName
    Else
        Me.PhotoImage.Picture = ""
    End If

End Sub

Private Sub Form_Load()

    DoCmd.Maximize

    Randomize

    LoadPhotoList

    If PhotoCount > 0 Then
        Me.TimerInterval = 5000
        ShowRandomPhoto
    Else
        MsgBox "No photographs found in this album."
    End If

End Sub

Private Sub Form_Timer()

    ShowRandomPhoto

End Sub

Private Sub Form_Unload(Cancel As Integer)

    Me.TimerInterval = 0

End Sub

David Clement OP  @Reply  
      
3 hours ago
As I said, I would have rather learned from you!
David Clement OP  @Reply  
      
3 hours ago

David Clement OP  @Reply  
      
3 hours ago
Design view is the only way I could do this.
John Davy  @Reply  
         
38 minutes ago
Hi David, You can learn a great deal by studying the vba. John
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 11/29/2026 9:49:18 PM. PLT: 0s