Diaglog Box problem

SteveJtoo

Registered User.
Local time
Today, 09:16
Joined
Sep 26, 2012
Messages
50
My program opens a dialog box showing file folders. When I click on a folder to open it, I get it in 'file view mode'. I change it to 'thumbs mode' to see pics and its works ok. The next time i click on a file folder it opens again in file view and does not retain the thumbs view. I converted this program from Access 2000 to 2010. In 2000 the thumbs view was retained.

Since the routine settings open the initial dialog box, when I click on a file folder to open in thumbs view, where do those settings come from and how can I set it to retain thumbs?

HELP!!
 
My program opens a dialog box showing file folders. When I click on a folder to open it, I get it in 'file view mode'. I change it to 'thumbs mode' to see pics and its works ok. The next time i click on a file folder it opens again in file view and does not retain the thumbs view. I converted this program from Access 2000 to 2010. In 2000 the thumbs view was retained.

Since the routine settings open the initial dialog box, when I click on a file folder to open in thumbs view, where do those settings come from and how can I set it to retain thumbs?

HELP!!

Can you paste the code you're using to call the dialog? it would help a bit.
Are you making direct api calls?
 
Here is the code:

Option Compare Database
Option Explicit

Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type


Private Sub Cover_Click()

Dim OpenFile As OPENFILENAME
Dim lReturn As Long
Dim sFilter As String
OpenFile.lStructSize = Len(OpenFile)
sFilter = "All Files (*.*)" & Chr(0) & "*.*" & Chr(0)
OpenFile.lpstrFilter = sFilter
OpenFile.nFilterIndex = 1
OpenFile.lpstrFile = String(257, 0)
OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
OpenFile.lpstrFileTitle = OpenFile.lpstrFile
OpenFile.nMaxFileTitle = OpenFile.nMaxFile
OpenFile.lpstrInitialDir = "C:\Documents and Settings\MyName\My Documents\Books\"
OpenFile.lpstrTitle = "Use the Comdlg API not the OCX"
OpenFile.flags = 0
lReturn = GetOpenFileName(OpenFile)

If lReturn = 0 Then
MsgBox "Search Cancelled!", vbInformation
Else
Me!Cover = Trim(Left(OpenFile.lpstrFile, InStr(1, OpenFile.lpstrFile, Chr(0)) - 1))
End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom