• Just a fun program to use with Access. ((97/2k))

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Just a fun program to use with Access. ((97/2k))

    Author
    Topic
    #385278

    I replied to a post last night, and included an attachment which I wanted to get some feedback on. “Clicking Okay Button”

    It’s just a nifty little VB program, that ‘repeats/mimics’ Access dialog windows (query criteria prompting, Login boxes, etc etc.). I actually posted to several threads last night, and got replies on a lot of them, but this one I was really hoping to get some ‘reactions’ too. I know this sounds like I am starving for attention, but I really thought this little program was neat. Relatively useless, but neat. (Read the post post 238098, it explains what the program does, how to use it, and why I built it.)

    So post back with your initial reactions! evilgrin (let me have it!) bash (also, I am curious what versions of Access this works in….I only really tested it in 97….but it should work for 2k and XP….if you try it with those, let me know if it works or not). please

    Viewing 0 reply threads
    Author
    Replies
    • #663998

      Hi Drew,

      I just ran your program, and yes, you confused me. Here’s what I did, tell me what I did wrong or what I didn’t understand:

      1. Open my project, create new form, paste in code, and get hWnd value.
      2. Open your vb executable, paste in hWnd from step 1, click Start Timer.
      3. Went back to my project, closed the new form and opened my dialog form from the project I’m working on.

      Here’s what happened: your project created a blank dialog box with Yes No buttons. I clicked yes (don’t know why, maybe I’m just trying to be a positive person tongue ). Then that’s it. What should I be doing next?

      FYI, I don’t have VB installed on this pc (for many reasons), so I can’t look at the source.

      The project sounds cool, anyway cool

      • #664004

        Just a real quick reply to this. I’ll give an explain a little later (I’m just heading into work…so I’m a little rushed).

        This program is not going to work for dialog FORMS, only dialog windows. For example, put [What Number do you want?] in the criteria portion of a field in a query. The window that will prompt you with that text, for a response, that’s a dialog ‘window’. A form is something you can open in Access and change how it looks. A window is something the system generates, that you can’t control the format of. (Yes, you can change the icon and title of a MsgBox (which is a dialog window…same with the InputBox…etc.).

      • #664108

        Okay, I finally have a free moment now, so I am going to explain a little quirk I found with Microsoft Access ‘form’ windows. First of all, I am attaching another VB program (just the .exe). When you run this program, it will show you various information about whatever window your mouse is over. You will notice that even moving the mouse around that VB programs window, you will get different windows showing up. A window for the main window, the text boxes show up as their own windows, the listbox, etc. That is because those controls have their own hWnd value, and can actually be ‘treated’ as a window. (There are a ton of API calls that let you do all sorts of things to a ‘window’, you just need to know the hWnd.)

        Now, here’s what is quirky with Access. Open a session of Access, and then open a few forms. Each ‘form’ will show to have a main and a ‘sub’ window, where the ‘sub window’ is the content of the form, the main window will be the border/caption. None of the controls show up as their own window…..UNLESS that control becomes the ‘active’ control. When another control gets control, it now shows up us that ‘special’ window…with the same hWnd value. This is pretty wierd. At least from a Windows standpoint.

        Anywho, the reason my little mimic program only works on a dialog window (not a form… (other dialog ‘windows’ would be error messages, Action Query prompts, etc.)), is because my code can’t ‘tell’ what controls are on the form by using the Window API’s. I am working on a process for ‘detecting’ and creating those forms, by using automation.

        Does that all make sense?

        • #664142

          Perfect sense, Drew! and that proggie is pretty neat!

          Great explanation, too. I never realized that that was the difference between working in Access and VB. When I was working in VB it was always such a different platform than Access, but yet the same.

          BTW, I used it both in XP and 2000. I can do it on my 97 machine this weekend if you’d like, but it sounds like you don’t need that.

          Are there some particular results you’re looking for?

          • #664144

            I was just curious if it works in 2000 and XP, I know it works in 97.

            No real results, this was just a test project, which was later incorporated into a larger project. The larger project let’s you run the Access database on one machine, and recieve the ‘prompts’ on another. That larger project is on hold right now. I was just getting real close to finishing it, when I realized that it didn’t handle actual forms. So when I start working on that project again, I will be having it mimic forms too. The real purpose will be to have a Web interface ‘instantly’ available for an Access db. Though a side ‘effect’ will be allowing a VB interface too.

    Viewing 0 reply threads
    Reply To: Just a fun program to use with Access. ((97/2k))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: