+ Reply to Thread
Results 1 to 14 of 14

VBA Screen

  1. #1
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    VBA Screen

    Hello, I just finished a project that creates forms dynamically and my only problem is that the VBA editor screen keeps poping up every time a form is created, anybody know how to fix this?

    Thanks in advance!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: VBA Screen

    One may assume you have an error in your code.

  3. #3
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    Hmmm nope, it runs without errors, loads the form correctly according to what I said in the query that generates it....it just pops me the window of code, I close it manually and start working with the form, but I want it not to appear or to be able to close it by code...

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: VBA Screen

    What's the code?

  5. #5
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    Please Login or Register  to view this content.
    I use this same code 3 times, this one is to generate an extract from a table....I needed to do it like this because on a continuos form I wasn't able to paint a textbox a certain color depending on the value from the preceding record

    the next time I use a very similar code to this, is to generate the preview from this first form, and if everything is alright, then save the data to a new table and drop the previous one

    the last time I need this code is to update the date values from these saved records....

    If there's an easier way to do all this I'd appreciate if you can share that knowledge with me, this database has to be split, then shared with 5 users and I don't want it to keep crashing (that's another problem, sometimes after hitting the save button, it saves the records, crashes, and when it restarts the file is corrupted)

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Screen

    I'm getting an error here:

    Please Login or Register  to view this content.
    Which library needs to be installed?
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  7. #7
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    In Microsoft Access the CurrentDb method establishes a hidden reference to the Microsoft Office 12.0 Access Conectivity Engine object library in a Microsoft Access database.

    I didn't know about the library...got the reference from here:
    http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Screen

    My bad, I was trying to run this in Excel vba. I'll open Access up and try again.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Screen

    Can you explain further why are you creating these forms dynamically?
    If posting code please use code tags, see here.

  10. #10
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    Yes...

    I need to be able to paint the background of the textboxes on the Tool Field in yellow or red if the preceding record is different from the actual record, and the Resin Field needs to be colored in orange if its value is different from the preceding record (first record is always painted, comparinsons start from record 2 to record N)

    If I did the form as a continuos form it would paint all the textboxes (even with the loop cycle) with the last color from the last comparison, and that doesn't work with what I was required to do. So the only option I had was to select the data from the table, and based on the number of records retreived, generate them via VBA with a do while cycle, and that way I had individual textboxes for each record, each with its own unique name, and therefore I'm now able to make the coloring of the texboxes as I need to...

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Screen

    Did you try Access' conditional formatting?

  12. #12
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    yes, same result, it colored all the records textboxes, even if the values were the same, they were both colored, and that doesn't work for the project...

  13. #13
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    FYI...I started this project in Excel, it was way easier there (comparing one cell to another instead of a record in a recordset), but they told me it needed to be a multiuser system, so the Excel macro wasn't the best option, that's why I created it with Access

  14. #14
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Screen

    Well, the poping vba screen is still an issue, but I think I managed to prevent the DB to keep crashing over and over again, I just needed to set all the variables and controls to Nothing before the End Function and it appears the problem is solved

    Also, I changed this
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    By deleting / commenting the lines shown here, it appears to work faster and without the risk of crashing the DB, I use this similar block of instructions 3 times for 3 different scenarios in the system, and after 2 hours of testing, no crashes have been registered.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 10-29-2014, 03:41 AM
  2. Replies: 4
    Last Post: 01-23-2014, 07:05 AM
  3. [SOLVED] Adjust screen resolution automatically to fit all screen sizes
    By Ace_XL in forum Excel General
    Replies: 2
    Last Post: 06-14-2012, 08:51 AM
  4. Replies: 10
    Last Post: 04-19-2011, 09:27 PM
  5. [SOLVED] print box opens in right screen of dual screen setup why
    By gerrys in forum Excel General
    Replies: 1
    Last Post: 06-30-2006, 01:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1