Results 1 to 4 of 4

Thread: Data Environment

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    153
    In a Data Environment Command sql statement I want to set the name to be retrieve to equal the combo1 text. Also, how would I refresh a datagrid in combo_click event? This what I have:

    SELECT Name, Account, Qtr1
    FROM Act
    WHERE name = '" & Trim(frmDataEnv.Combo1.Text) & "' AND
    (Account = 'ret_prem_g' OR
    Account = 'nii_gaap_inya' OR
    Account = 'reclass_rcg' OR
    Account = 'tot_revenue' OR
    Account = 'tot_benefit' OR
    Account = 'tot_inc_fpb' OR
    Account = 'tot_acq_exp' OR
    Account = 'opex_gaap_inya' OR
    Account = 'tot_deduct' OR
    Account = 'life_gaap_opinc' OR
    Account = 'tot_rcg_bef_taxmi' OR
    Account = 'life_net_inc')

  2. #2
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    Refreshing in ADO - DE requires rebinding your bound control. Do this:

    Set Datagrid1.Datasource = Datagrid1.Datasource

    As to your DEC - SQL, i believe you need to use parameters... unfortunately i haven't used it so i can't tell you how just yet...

  3. #3
    Guest
    hi
    first of all set up a dummy query in the dataEnvironment,
    then overwrite it using the code below.

    dataEnvironmet1.Commands("Command_Name").CommandText = "select ... where xyz = form1.txtName"


  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    153

    Data Environment

    I tried playing with the suggested code, but to no avail. Not sure how to go about inserting the code. In the Data Environment code module I inserted the following code:


    Private Sub rsCommand2_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
    dataEnvironmet2.Commands("Command2").CommandText = "SELECT Name, Account, Qtr1 From Act WHERE name = '" & Trim(frmDataEnv.Combo1.Text) & "' AND Account = 'ret_prem_g' OR account = 'nii_gaap_inya' OR Account = 'reclass_rcg' OR Account = 'tot_revenue' OR Account = 'tot_benefit'"

    End Sub

    If I went about it the right way, I'm getting the error message "proceduce declaration doesn't match description of event"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width