Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

Crash when F.Requery returns no records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 21 Jan 2005 21:03 GMT
I am using the code below to synchronize two forms. The relationship is one to many.  It works fine until I go to a record in the main form that doesn't have any records in the popup form.  Check18 is a check box.  When checked the popup is open.

Private Sub Form_Current()
 If Check18 Then
   Dim F As Form
   Set F=Forms![popup]
   F.RecordSource="Select * FROM popup Where [id]='" & Me![id] & "';"
   F.Requery
 End If
End Sub
John Vinson - 22 Jan 2005 00:42 GMT
>I am using the code below to synchronize two forms. The relationship is one to many.  It works fine until I go to a record in the main form that doesn't have any records in the popup form.  Check18 is a check box.  When checked the popup is open.
>
[quoted text clipped - 6 lines]
>  End If
>End Sub

What sort of "crash"? What error message do you get?

In fact the Requery should not be necessary. Simply setting a Form's
Recordsource to a text string should do the initial query.

I'm wondering why you want to do this in this way - might not a
Subform (which does the same thing with no code), or closing and
reopening the popup form with a WhereCondition in the OpenForm call be
preferable?

                 John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.