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 / April 2005

Tip: Looking for answers? Try searching our database.

updateable snapshot recordset in sub form.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 20 Apr 2005 16:33 GMT
Hi

I have createed a  form with a sub form. I populate this subform with data
with the code below.

When I cursor into a cell in the tabular datasheet I can't edit the cell in
any way.

If i create a subform that uses a design time recordsource (i.e. a table)
without writing any VBA code  I can edit it no problem but now that I am
loading it programmatically I can' t get a updateable recordset that
automatically updates my remote SQL database when ever I change values in the
table cells.

I'm using an Access data project.

How do I make it updateable snapshot? as found in the properties sheet at
design time?

here is my code to fill the subform.

Me.subReportMain.Form.RecordSource = ""

If storeprocedurename = "SearchByTransitGL" Then
   strsql = "EXEC SearchByTransitGL '" & searchvalue1 & "'," & searchvalue2
Else
   'strsql = "EXEC searchbygl '" & searchvalue1 & "'"
   strsql = "EXEC " & storeprocedurename & "'" & searchvalue1 & "'"
End If

   Set cnn = New ADODB.Connection
   cnn.ConnectionString = Application.CurrentProject.BaseConnectionString
   cnn.Open
   Set Rst = New ADODB.Recordset
       With Rst
                 .CursorLocation = adUseClient
                 .Open Source:=strsql, _
                 ActiveConnection:=cnn, _
                 CursorType:=adOpenDynamic, _
                 LockType:=adLockOptimistic
           
           If .RecordCount = 0 Then
            MsgBox "No Records Found"
           Else
           
             Set Forms!frmMainViewEdit.Form!subReportMain.Form.Recordset =
Rst

           End If
           .Close
       End With
   cnn.Close
   Set Rst = Nothing
   Set cnn = Nothing

thanks for looking at this.

Chris
Rick Brandt - 20 Apr 2005 16:55 GMT
> Hi
>
[quoted text clipped - 54 lines]
>
> Chris

I don't think the result set from a Stored Procedure is ever editable.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Chris - 20 Apr 2005 17:17 GMT
Hi,

I forgot to mention that in my experiment without VBA I did use a stored
procedure
as my recordsource and it is updatebable.

just need to get it to be updateable from code.

> Hi
>
[quoted text clipped - 54 lines]
>
> Chris
 
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.