Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178

    Question Unanswered: Assigning value from recordset to text field

    I've created a recordset which calculates 2 values.
    I want these values displayed in textfields:

    Dim AmtQry AS DAO.recordset

    Set AmtQry = CurrentDb.OpenRecordset("SELECT Sum([OrderAmount]*[UnitValue]) AS TotalValueOrdered, Sum([ReceivedAmt]*[UnitValue]) AS TotalValueReceived FROM tbl_PurchaseOrder WHERE PONumber= '" & Me.Combo1.Value & "';")

    Me.Text78.Value = (AmtQry!TotalValueReceived)
    Me.Text80.Value = (AmtQry!TotalValueOrdered)

    but i get the following error: runtime err 91
    'Object variable or with block variable not set'

    What could the problem be?
    thanks in advance
    ActionAnt

  2. #2
    Join Date
    Feb 2004
    Location
    Kuwait
    Posts
    9

    Fields

    do this and see

    Me.Text78.Value = AmtQry.fields("TotalValueReceived")
    Me.Text80.Value = AmtQry.fields("TotalValueOrdered")


    Good Luck

Posting Permissions

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