PC Review


Reply
Thread Tools Rate Thread

Requery doesn't update datasheet subform

 
 
=?Utf-8?B?VmVybGU=?=
Guest
Posts: n/a
 
      10th Nov 2003
I have a form with a tab control where the first tab is a group of unbound controls used to enter data to search a table for data - a query is generated and saved using an SQL statement via code. If a single result is obtained, a new form is opened to display all the record details, but if multiple results are obtained, I switch views to the second tab on the form which has a datasheet view subform to display the query results. My problem occurs when the user switches back to the first tab and conducts a different search, the query is updated (I manually open it to check), and the code switches to the second tab, but the new query results are not displayed - the original query results are still there. I have tried several variations of the requery command to try and get this working, all of which have failed. The only thing I have been able to do to work around the problem is to close and reopen the form. Right now, my form name is FrmSelection, subform name is SubFrmResults, and the control for the subform is SubFrmReslutsCtl. Here are some of the variations of requery I have tried to get the datasheet view of the subform to dsplay the updated query without closing and reopening the main form:

Me.SubFrmResultsCtl.Requery

SubFrmResultsCtl.Requery

SubFrmResults.Requery

Me.Requery

Dim ctrl As Control
Set ctrl = Forms!FrmSelection!SubFrmResultsCtl
ctrl.Requery

None of these worked - any ideas? Are there other code steps I need to do? Does the subform need to have the focus for the requery method (I think I tried it, but probably not with all the above iterations), or some other setup I am not doing? Other factors possibly of interest - the background table is not meant to be updated from this application (it is for viewing purposes of the background table only), so I have the subform properties set for No Edits, Additions or Deletions (but since the source for the subform is actually a query of the table - a query that needs to be changed, could this be a problem?). The subform is set for Dynaset Recordset type, and since this is for viewing only, No RecordLocks.

Thanks in advance for the help,

Verle
 
Reply With Quote
 
 
 
 
Dev Ashish
Guest
Posts: n/a
 
      10th Nov 2003
"=?Utf-8?B?VmVybGU=?=" <(E-Mail Removed)> wrote in news:5FA2F251-D125-
4C14-8C15-(E-Mail Removed):

> Dim ctrl As Control
> Set ctrl = Forms!FrmSelection!SubFrmResultsCtl
> ctrl.Requery
>
> None of these worked - any ideas?


Try
Forms!FrmSelection!SubFrmResultsCtl.Form.Requery


-- Dev
 
Reply With Quote
 
=?Utf-8?B?VmVybGU=?=
Guest
Posts: n/a
 
      14th Nov 2003
Still doesn't work! I am at a total loss.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery subform doesn't display all records kbremner@beeline-online.net Microsoft Access 1 16th Jan 2011 08:11 PM
RE: Subform that doesn't requery =?Utf-8?B?bml1Z2luaWtpd2k=?= Microsoft Access Form Coding 0 4th Jan 2007 12:34 AM
Refresh & Requery on subform(datasheet) =?Utf-8?B?c2tr?= Microsoft Access Form Coding 4 28th Feb 2006 12:45 PM
Requery Lookup based on Datasheet Subform Alex Microsoft Access Queries 0 27th Jan 2004 03:46 PM
Requery doesn't update datasheet subform =?Utf-8?B?VmVybGU=?= Microsoft Access Form Coding 0 10th Nov 2003 01:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:01 AM.