Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Requery does not show new rows.

Requery does not show new rows.

Requery does not show new rows.

On Form0 I have a tabbed form.  On Page1 I have Form1. On Page2 I have Form2.

Form1 has a button that adds a row to Table2 that is displayed by Form2

Form2 is a continuous display form that uses a query as its Record Source to display Table2 rows.

After clicking the button on Form1 to add a row to Table2, I click on Page2. Form2 does not show the new row.

I've tried adding to the end of the button_click() routine: Forms!Form0!Form2!Form.Requery

If I exit Form0 and reopen it, Form2 displays the new row.


RE: Requery does not show new rows.

Do you get any error messages?
Does your code compile?
Do you have Option Explicit in your code General Declarations?
Is Form2 the name of the subform control on Form0? The name of the subform control is not always the same as the source object.

Can you share your actual code?

Hook'D on Access
MS Access MVP

RE: Requery does not show new rows.

Yep. Sorry,  I typeo'd the post. I have the dot in the real code. It doesn't work. I tried other approaches. This is the latest...real code.

DBTracker is a tabbed form. One of the tabs holds the form "People", and another form "EmailTracker"

'   Code executed from button on the People subform of DBTracker
'   The SQL statement is built.
'   The SQL statement is executed.
'   A row is added to the EmailTracker table'
'   The EmailTracker form is Requery'd
'   But when the tab with the EmailTracker subform is clicked,
'   The new row is not displayed.
'   However, now with the latest change to the Requery
'   statement, when another row is added, both rows are then
'   displayed.
'   It's like the first Requery was buffered. This "buffering' repeats. It's like it takes more than one new row to be added before the "Requery" will display them.

strSQL = "Insert Into EmailTracker (RecipientID, _
          EmailType, EmailDatelastGenerated) values _
          (" & Me!ID & " , 'Verify DBA', '" & Now & "');"

CurrentProject.Connection.Execute strSQL, , _
          adCmdText + adExecuteNoRecords



RE: Requery does not show new rows.

Do you understand the difference between the subform control's Name and its Source Object?

If the code is running from a subform, try:



Hook'D on Access
MS Access MVP

RE: Requery does not show new rows.

Yep, I know the difference. And yes, I named them the same. I'm not very imaginative :)

I tried tweaking the Requery. This works. Yippee!!!


Can someone provide a technical explanation of the difference between the above statement and the one below that doesn't work so well?



RE: Requery does not show new rows.

Ah. Is it that one refers to the Control and the other refers to the Source Object?

The light might be getting a bit brighter.

RE: Requery does not show new rows.

Access 2003. Can you tell me more about the rule?

RE: Requery does not show new rows.

papadilbert . . .

I'm not so sure its the form referencing at fault. In fact I query the ADO method your using. I'm not hot on ADO yet and it would take to long for me to nail it if there is a problem. What I suggest is a DAO version in a temporary button for testing. The code for the temp button would be:


   Dim db As DAO.Database, SQL As String
   Set db = CurrentDb
   SQL = "Insert Into EmailTracker (RecipientID, " & _
                                   "EmailType, " & _
                                   "EmailDatelastGenerated) " & _
                           "VALUES (" & Me!ID & " , " & _
                                    "'Verify DBA', " & _
                                    "'" & Now & "');"
   db.Execute SQL, dbFailOnError
Let me know how this fairs. If it works then there's some problem in your ADO ... perhaps how the connection is setup (just a guess).

Your Thoughts? . . .

See Ya! .  .  .  .  .  .

Be sure to see FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?  Worthy Reading! thumbsup2
Also FAQ181-2886: How can I maximize my chances of getting an answer?  Worthy Reading! thumbsup2

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close