SpiritualMadMan 39 Junior Poster in Training

To get viewit to work with GIF's comment out Get_BMP_Info(uFileName As String) in the Main Module.

And, add ;*.gif as shown below...

Private Sub picInput_dblClick()
FN.cmboExts = "*.bmp; *.gif"

on the main form

SpiritualMadMan 39 Junior Poster in Training

You can use an Image Control or Picture Box to load and display a .GIF file (among others)

An Image Control allows stretching the .GIF to fit.

See the attached .zip for some ways to "play" with Images.

What "ViewIt" does is allows you to open a supported graphics file, transfer a part of it to an Image control to zoom in on it.

This was originally written to allow the creation of Phantom Test Driver code to allow exact co-ordinate positioning.


BTW when the app is first started it is likely that the other two forms will be hidden behind the top form...

SpiritualMadMan 39 Junior Poster in Training

This should work for DAO (and ADO, I believe)...

If you are doing SQL... Then I can't help you...

You have to use rst.Update to actually update the database record

You have to use rst.Edit to change fields in the record

Basically, once you open a RecordSet you have to .Edit to change things, then, when you're done changing things, you have to .Update to write the changes back into the database...

SpiritualMadMan 39 Junior Poster in Training

OK, took a look at the Datagrid and it does not allow access in a similar manner as the FlexGrid.

If I were you I would only use the datagrid to "see" your data and as an aid to selecting the data in the underlying database.

I would then look at selecting the appropriate Tables and fields and exporting them.

Again, I'd look at it as a two part excersize...

Export to a delimited Text File, first, and get that portion correct, selecting and exporting.

Then work on getting it into Excel.

Sorry, if my previous post caused any confusion.

I use the FlexGrid even for Databases and manually select Tables and Fields because it is much easier to loop through a FlexGrid using .textMatrix(row,col).

At least for me... :)

SpiritualMadMan 39 Junior Poster in Training

I do a lot of stuff with the MSFlexGrid...

I usually get real lazy when it comes to importing data into Excel.

What I normally do is export the grid and Tab Delimit the fields into a text file.

Then "Open With" Excel, after which I can save as a regular Excel File.


As to how to do it directly...

I've been too lazy to attack that problem, yet. :)

But, I suspect that after you build the export to Tab Delimited portion, and get it working, you can then learn how to access Excel and instead of writing to the text file write to the Excel Cells in your target workbook.

SpiritualMadMan 39 Junior Poster in Training

I actually mean that I open "My Computer" and right click a file, the click "Open With" and select my program. Then my program should get the file's path.

That would be SomeVarName = App.Path

This gives you the Path where your Application is at...

Specific FileNames would be SomeVarName = App.Path & "\" & YourAppsFileName

SpiritualMadMan 39 Junior Poster in Training

Another thought...

When I expect more than one file to be opened. For instance I have a Test Procedure File (.prc) and an INI file I will put all the handler routines in a module an (shudder) use Global variables (if needed, due to Multiple Forms and Multiple Module Sturcture) for the Filenames and File Handles.

If a File Handle equals zero then the file hasn't been opened.

I use the same FN form and take the FN.Filename and FN.Dir to assisn the Path and Filename to the variable and when I open the file I first get INI_NUM = Freefile and use that handle throughout the project to access the file.

SpiritualMadMan 39 Junior Poster in Training

Agreed, though I have done most work in DAO not ADO or SQL...

This error, though not as bad as the illegal "Null" error, usually requires a type conversion when going into the RecordSet.

And, sometimes when retrieving, as well.

SpiritualMadMan 39 Junior Poster in Training

What method are you using to "Open" the file in Question?

I have a Form I copy into my project space when I want to access files...

Copy the code below into a text file and then rename it FN.frm

Because the FN form can be thought of as a separate Class or Object anything on the form can be accessed using FN. until the form is unloaded.

Let me know if it helps. :)

VERSION 5.00
Begin VB.Form FN 
   AutoRedraw      =   -1  'True
   Caption         =   "Select Files"
   ClientHeight    =   7950
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4365
   Icon            =   "FN.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7950
   ScaleWidth      =   4365
   StartUpPosition =   2  'CenterScreen
   Begin VB.TextBox txtNewFile 
      Height          =   435
      Left            =   105
      TabIndex        =   8
      Text            =   "Text1"
      Top             =   3570
      Width           =   4110
   End
   Begin VB.ComboBox cmboExts 
      Height          =   315
      Left            =   2205
      TabIndex        =   5
      Text            =   "Combo1"
      Top             =   3000
      Width           =   1995
   End
   Begin VB.FileListBox File1 
      Height          =   2820
      Left            =   2200
      TabIndex        =   2
      Top             =   90
      Width           =   2000
   End
   Begin VB.DirListBox Dir1 
      Height          =   2790
      Left            =   120
      TabIndex        =   1
      Top             =   100
      Width           =   2000
   End
   Begin VB.DriveListBox Drive1 
      Height          =   315
      Left            =   100
      TabIndex        =   0
      Top             =   2940
      Width           =   2000
   End
   Begin VB.Label Mode 
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   195
      Left            =   1050
      TabIndex        =   9
      Top …