Results 1 to 4 of 4

Thread: Database's

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    1

    Question

    Does anyone know how to calculate the value of cells in a database field. I'm new to vb and i'm trying to multiply one cell times another cell in my program and i cant figure it out. Also i was wondering if you don't have acess can you use another database to link to your vb project. And if so how? Thanks


    Here's some source code of what I've been trying to do


    Example1

    Private Sub DataGrid1_Click()
    Set rsta = Adodc1.Recordset
    rsta.Fields(0).Value X rsta.Fields(1).Value = rsta.Fields(2).Value

    End Sub

    Example2
    Private Sub DataGrid1_Click()
    Set rsta = Adodc1.Recordset
    rsta![field name2] * [field name2] = [field name3]

    End Sub





    [Edited by Squid13_2000 on 09-25-2000 at 02:50 PM]

  2. #2
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83
    Show us some code sample. Source code helps a lot when trying to figure out problems.
    Sincerely yours,

    Patrice B.
    Information System Analyst
    SAS 9.1.3, VB6 SP6, VB.Net 2003, SQL7.0/2000

  3. #3
    Guest

    IF you want the result in field3 then try
    something like this: :

    [field name3] = [field name2] * [field name2]

  4. #4
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83

    Red face

    Silly Billy me...!

    I was propably asleep when reading your post...

    Try:
    Code:
    rsta!ResultField = rsta!FirstField * rsta!SecondField
    It should work

    Sincerely yours,

    Patrice B.
    Information System Analyst
    SAS 9.1.3, VB6 SP6, VB.Net 2003, SQL7.0/2000

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