+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 25

Thread: VBA Requery Problems

  1. #11
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    Ok i am going to try a different approach. This is the access file I am working with. The forms are master (parent) and qry180expincdailynet (sub)
    Attached Files

  2. #12
    Barn Newbie RuralGuy will become famous soon enough RuralGuy's Avatar
    Join Date
    Mar 2008
    Posts
    44
    Rep Power
    4

    The name of your 2nd SubFormControl was Qry180ExpInc<C>Daily and not qry180expincdailynet so I changed it and it works.

  3. #13
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    Thank you so much. I am no longer getting errors but it doesnt seem to be updating as I thought it would. Maybe I have a misunderstanding how this would work. I anticipated that it would update to the new average once I moved from the two fields I added the VBA to. it is my understanding that when I move from one field to another that it has lost the focus at that point. Please tell me if I am wrong. I am also going to show you what I wrote just incase that is the problem.

    [Forms]![master].[Form]![qry180expinc<C>dailynet].Requery

    Also I dont understand why the first part is "forms" plural and the second part seems to have to be "form" singular

    Again thanks for all your hhelp and I am sorry that this is taking so long for me to get

  4. #14
    Barn Newbie RuralGuy will become famous soon enough RuralGuy's Avatar
    Join Date
    Mar 2008
    Posts
    44
    Rep Power
    4

    Did you look at the link I posted in post #7?

  5. #15
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    yes i did. i didnt really understand it very well. what i do get from it is that there are different ways to write these expressions from situation to situation.

    I see Me.something in examples there and also in some of my books i read. I dont know what it means. Can you explain that.

    Now the gist of all our correspondence and that chart to me says that I identify the "object" that I want to work with and then at the end I do an action like "requery" we are currently working on. Again, I dont understand what "me." means. I hope I conveyed how I am confused. Thanks again.

    .

  6. #16
    Barn Newbie RuralGuy will become famous soon enough RuralGuy's Avatar
    Join Date
    Mar 2008
    Posts
    44
    Rep Power
    4

    Me is simply shorthand for referring to the object from which you are executing be it a Form or a Report.

  7. #17
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    Ok then I see from that chart that I should choose:

    Me!subform2.form.recordsource.requery

    because I am sub1 and refering to sub2 and I want to requery sub2

    Is that right and how would I write it. I am still a tad unclear what "me" represents in my particular circumstances and what I would say for recordsource

    This is my first time really trying this and it is a little confusing. I apologize for it taking so much effort

  8. #18
    Barn Newbie RuralGuy will become famous soon enough RuralGuy's Avatar
    Join Date
    Mar 2008
    Posts
    44
    Rep Power
    4

    This should do it:
    Me.Parent.SubFormControl2.FORM.Requery

  9. #19
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    Thank you for getting back to me so fast but I still dont know what I would put from my personal application in those places.

    I dont know what i would put in place of:

    ME

    parent I assume i am writing master (the name of the form)

    subformcontrol2

    would you please tell me the way i would write my VBA so i can understand what is getting plugged in where. I will include the zip file for your convenience
    Attached Files

  10. #20
    Barn Newbie RuralGuy will become famous soon enough RuralGuy's Avatar
    Join Date
    Mar 2008
    Posts
    44
    Rep Power
    4

    The syntax in the exit event of the FmCheckingEntry is now correct, although I would use the AfterUpdate event of the control. There was also the issue that the record from the FmCheckingEntry was never saved until you move to another record or close the form. That has also been corrected.
    Attached Files

+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast

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

SEO by vBSEO