Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    1

    Question Unanswered: File Open / Save As Function in Subform

    I have downloaded a working copy of a database that uses the File Open/Save As API (Dev Ashish ) that is in thread http://www.dbforums.com/t721798.html.

    I would like to tie file links to specific records in another table. For example, I have an order acknowledgement (OA) table. I would like to use the above downloaded code in a subform within my OA form. Somehow, I need to filter the links to just specific OA's. I haven't a clue how to do that.

    tblOrdAck (master)
    tbllink (child)

    ----frmOrdAck
    -------subfrmtbllink (how can I filter these records based on OANo in frmOrdAdk?)

    I'm teaching myself VBA as I go, but this time I think I'm in over my head. Can anyone help?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Opening/Linking to Files

    You can take a look at this example to see how file names can be stored in a table and then launched from a form listing them. It also let's you create a desktop shortcut to them. Hold down the shift-key while opening it as I use code to get rid of the MS Access information (ie. Call Module2.fSetAccessWindow(0) in the onLoad event of the Public Health form.)

    Sorry about the documentation and sloppy code. I'll try to clean it up. I did it in a few hours for a need at work. Also, use the PopulateTable Form to re-populate the tables to be used for the forms with the file listing (the Show button on the PopulateTable form can be remarked out.)
    Attached Files Attached Files
    Last edited by pkstormy; 07-27-07 at 22:06.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    If you're teaching yourself VBA as you go then API calls are certainly not a good place to be fishing around!

    I suggest you have a play with the example posted here and see how you get along!

    If you have any questions about how to use the FSO then ask away!
    HTH
    George
    Home | Blog

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    The thing with API's is not necessarily knowing how to write them (which can get you into trouble if coded incorrectly), but how to use them. They're not much different than calling a function but you want to make sure you call it correctly by reading all the comments in the API. I've only written a couple of them but I used them quite a bit when I was learning VBA and still use them often. I use several developed by Dev Ashish. The MSAccess Developer's Handbook (1 and 2) (Sybex) is an excellent resource for learning VBA and using API's if you have the need to use them (Chapter 7 and 11 for the File Open/Save method).
    Last edited by pkstormy; 07-29-07 at 04:23.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •