Re: Assigning value to subform fields

Tech-Archive recommends: Fix windows errors by optimizing your registry



You'll have to give us some idea of what ADOPRDBRW looks like. Once the
results are in a recordset, whether the rows came from Access or elsewhere
doesn't make much difference.

The connection to SQL Server has to be occurring in that function, or in a
function it calls.

Show us the function code.
--
Chaim


"Madhuri" wrote:

> Hi
>
> I have a form and subform created in msaccess database which used to refer
> to msaccess tables. I am trying to connect them to sql server ie, the
> mainform and subform should show data from sql server tables instead of
> msaccess tables. I successfully modified doing for the main form by opening a
> recordset and assigning text field value to recordset value for the field.
> But in subform which are in data*** view and are individual forms created
> in access
>
> I removed the recordsource property from design properties so that the
> fields became unbound but how do I set the new recrodset to the subform so
> that it refers to sql instead of access.
>
> This is the code I am using
>
> private sub showdtl()
> 'ADOPRDBRW function opens the recordset assigning it to valtgrst
> 'recordset type variable)
>
> Call AdOpRdbrW("SELECT ClmFlg, provid, memberid, name, icn, dos,
> billedamount, totalpaid, dxcode, " & _
> "procedurecode, insuranceeffdate, insuranceenddate,
> Revenuecodedescription, " & _
> "ClaimPaidDate, ProviderName FROM claimsdetail", vAltGrst)
> If vAltGrst.EOF = False Then
> Me.CORERECOUP_CAK0505_M0014_subform.Form.Recordset = vAltGrst
> End If
>
> end sub
> "RuralGuy" wrote:
>
> > "=?Utf-8?B?TWFkaHVyaQ==?=" <Madhuri@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > Hi all
> > >
> > > I am using access as a front end to sql server backend. I have a form
> > > with a subform and when the form is getting loaded I am assigning the
> > > master form with the field values by using a query to populate fields
> > > from sql.
> > >
> > > Now I want to assign values to subform using the same query. How do I
> > > refer to subform fields to assign values to each field ?
> > >
> > > Thanks
> > > Madhuri
> >
> > Here's a source if information on this topic you might want to bookmark:
> >
> > http://www.mvps.org/access/forms/frm0031.htm
> > Forms: Refer to Form and Subform properties and controls
> >
> > hth
> >
> > --
> > RuralGuy - Please post to the News Group so all may benefit.
> >
.


Quantcast