Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917


    Quote Originally Posted by Sa'El View Post
    I inputted this code, and although it compiled, nothing effectively happened:

    Private Sub Current()


    DoCmd.OpenForm "Patient Detail", , , "[ID]=" & ID, , acDialog
    Me.Requery

    End Sub
    Even when selecting different records?

  2. #17
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40
    It didn't make a difference.

    I clicked any field, and nothing happened. Logically, I'm wondering why it would work since wouldn't it still require a Click Event so that the program would know what would trigger the code block. Would "current" be a little too simplified for it to work as intended (which again is to click any given field and the corresponding detail form would be opened)?

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Any chance you could post enough of your db so we could try it? You can create a new db and *import* just enough of the original to test. Zip it up and attach to a post.

  4. #19
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40
    I've attached the whole thing, as I wouldn't mind a critique of it (but don't feel obligated to if you're not interested, of course). Just bear in mind that this was a learn as I go project and this was my first time using VBA.

    I have used the custom option in the navigation pane to organize the database in relation to the questionnaire and have taken the time to organize the relationship diagram, if interested. As I haven't finished yet, some objects remain unassigned, and this is where you'll find the two forms in question:

    The main form is called "Main Overview" and the detail form after clicking is called "Patient Detail".

    I have done some reading otherwise and I came across something that implied that there may be some code limitations with Split Forms, which could explain why the "current" code didn't work.


    Thanks again.
    Attached Files Attached Files

  5. #20
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Just for the record, there IS a Current event each time you select a *different* record.
    Attached Files Attached Files

  6. #21
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    The problem I see is the Current Event *only* fires when you change records. If you change a record and return and decide you didn't change it correctly, you need to go to a different record and then back to the one you changed to get it to pop up again. Not very friendly. It also appears that the Split Form does not honor the acDialog command and wait for the next form to close before continuing with the code. That causes the Current Event to fire repeatedly as the Me.Requery executes until you run out of stack space.

  7. #22
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40
    So close, but yet so far away. A genuine "thank you" for trying though.

    Considering that changing the Patient Detail to Dialog did work so that the me.requery would run after closing the form (preventing the #Deleted to be seen in the Main Overview form), I'm wondering what's the difference?

    In any case, I'll continue to learn, although for now I have to do redundant coding.

    Thanks again for the help RG.

  8. #23
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    We tried. Good luck with the project.

  9. #24
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40
    Thank you. The journey is often more important than the destination. I learned about opening a form in Dialog and that there are potential coding limitations depending on the type of form you use (the latter of which is disappointing), both of which will serve me well for the future.

    Until next time...

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-28-2013, 07:54 AM
  2. Replies: 2
    Last Post: 03-11-2013, 08:04 PM
  3. Replies: 1
    Last Post: 03-30-2012, 11:57 PM
  4. Replies: 4
    Last Post: 08-17-2011, 05:30 AM
  5. passing variable from modal form to main form
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 06-03-2011, 05:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums