Results 1 to 14 of 14

Thread: Save a form to Access

  1. #1

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Save a form to Access

    VB6 / Access 2002 / ADO

    Is it possible to save an actual 'VB form' to a database?

    Or would I have to save a path to a folder where it could be stored?

    Any ideas would be great

    Thanks
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Save a form to Access

    Save the physical form itself?

    Why would you need to do that?

    You can save a physical file to a database as a BLOB (Binary Large Object) and retrieve it again. But, once retrieved, what would you do with it?

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Save a form to Access

    Saving the path to where the form files are stored is preferred. You wont overcomplicate your code, you wont over bloat your databaase, safe against db corruption loss of your form data, etc.

    Or you could safe all the text that defines the form in your table for recreation of the form on the fly. Just have to figure out the resx files as they may have to be stored on the file system or in the db.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Re: Save a form to Access

    Quote Originally Posted by Hack
    Why would you need to do that?
    I was just thinking about somewhere to save forms.
    I have various examples of how to do things on some forms, and I thought that it might be a good idea to have these examples saved all in the one place, and as I am writing a Code Library .....

    Quote Originally Posted by RobDog888
    Saving the path to where the form files are stored is preferred.
    I did wonder if this was a better option.
    If I saved the path to where the form was saved, how would I use the path to restore / open the form?

    Quote Originally Posted by RobDog888
    you could safe all the text that defines the form in your table for recreation of the form on the fly
    Again, I did think of this option, but it would probably be my second choice, but probably only because the other option has the form all ready to use, and hopefully it won't be too hard to do and use.
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Save a form to Access

    If you are looking to provide examples, why not create something like a Word file or a Help file?

  6. #6

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Re: Save a form to Access

    Quote Originally Posted by Hack
    If you are looking to provide examples, why not create something like a Word file or a Help file?
    Could you expand on that a little bit.
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Save a form to Access

    Quote Originally Posted by aikidokid
    I was just thinking about somewhere to save forms.
    I have various examples of how to do things on some forms, and I thought that it might be a good idea to have these examples saved all in the one place
    As you come across these take a screen shot, dump it to a Word document, type in whatever directions you think would be helpful regarding the screen shot, and then have your program open this document whenever the user (in this case, you ) needs to.

    This is easier than creating an actual help file. After this program is in the bag, they may be something to tackle next.

  8. #8

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Re: Save a form to Access

    Quote Originally Posted by Hack
    As you come across these take a screen shot, dump it to a Word document, type in whatever directions you think would be helpful regarding the screen shot, and then have your program open this document whenever the user (in this case, you ) needs to.
    Hey, I like this idea

    So, save the word document to the database.
    Then, when the user (me ) clicks on the relevent node, it open a word document.

    Sounds fairly simple (famous last words )

    Does Access save documents with pictures in it just as a straight forward document?
    I have read different articles about how to save images to a database.
    How straight forward is this?
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Save a form to Access

    I was actually referring to saving the Word document to disk and calling it from your program.

    However, you could save it to your database. I've never done this with Access, but I have with both SQL Server and Oracle. Saving files directly into a database is a topic covered in our Database FAQs.

  10. #10

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Re: Save a form to Access

    Quote Originally Posted by Hack
    I was actually referring to saving the Word document to disk and calling it from your program.

    However, you could save it to your database. I've never done this with Access, but I have with both SQL Server and Oracle. Saving files directly into a database is a topic covered in our Database FAQs.
    I know I am writing this program just for me to use but it was and is also a learning process as well.

    What do you think of this idea:

    Save two files to the database.
    First could contain any code for the form, in the same way all my other code is stored.
    Secondly, save the Word document to the database.

    Then when I click on the relevant node, the code is opened in the code library window, and an instance(?) of MS Word is opened and displays the saved word document, with images etc.

    Apart from me learning new things with VB, would this be a viable option.
    I don't want to do something if it's not necessarily the best way.
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  11. #11
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Save a form to Access

    Sometimes, for some examples it is usefull if you store the files.

    You can store a form in access in a BLOB field. (same way you store a picture in access. google for code.)

    You could tell the user to select the folder containing the project/form files (or individual files). Then zip them using zlib library and store in access blob field as an attatchment.
    When user wants to open the file, unzip it in Temp folder and ShellExecute the vbp or frm file.

    You'll need to store frx files too.

    You could also open the project file in text mode and from there you can get the list of frm/mod/cls files you need to store.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  12. #12

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Re: Save a form to Access

    iPrank, I am interested in this approach, although it may be a bit advanced for me at the moment.

    At the moment I am looking into the suggestion by Hack, using a screenshot and saving it in MS Word.

    Could you expand on this a bit on how I would start to go about writing this.
    I am not after the code, just the way and order to start writing something like this.

    I wouldn't be storing many forms in the DB, so size isn't going to be a problem, and the program is for me to use so I can do this whatever way works for me.
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Save a form to Access

    Check RhinoBull's signature for the "how to..." on storing and retrieving objects to an Access db.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Save a form to Access

    http://www.vb-helper.com/howto_database_picture.html

    Same technique can be applied for any type of file.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


Posting Permissions

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



Click Here to Expand Forum to Full Width