addition of values in two unbound textboxes and assigning to a bound textbox

nrmarthi

Registered User.
Local time
Today, 15:07
Joined
Feb 13, 2006
Messages
47
hello guys

i have values in two unbound textboxes and now i would like to assign the sum to a bound textbox. Also need AfterUpdate event too.

Can any expert help?

Thank you
 
Hi nrmarthi,

I suppose you just have to change this form's calculated field to bound and you've got it.

Good luck

Robert88
 

Attachments

Hi

am not sure of what it exactly mean. can you tell me bit clear

Thank you
 
Hi nrmarthi

What are you not exactly sure of?

Robert88
 
Hi nrmarthi,

This is a good one, even I need help...... ;)

I have created a table tblCalculate, query qryCalculate and form frmCalculate in the attached zip Calculate.

On the form I have created a button CmdSum which I was hoping to show you both unbound and bound additions, but even I have come unstuck..... :eek:

Can someone help, please

I have the following code for the CmdSum button;

Code:
Private Sub CmdSum_Click()

    'declare
    Dim Value1 As Double
    Dim Value2 As Double
    Dim SumValue1Value2
    Dim dbs As Database
    
    Set dbs = OpenDatabase("C:\Temp\Calculate\Calculate.mdb")
    
    'calculate txtValue1 & txtValue2
    Value1 = txtValue1.Value
    Value2 = txtValue2.Value
    SumValue1Value2 = Value1 + Value2
    MsgBox SumValue1Value2
    
    'Create a new record in the tblCalculate table.  The
    'Total is from addition of Value1 + Value2
    dbs.Execute "INSERT INTO tblCalculate " _
        & "(fldTotal) VALUES " _
        & "('" & SumValue1Value2 & "');"
        '" & s & "'
    dbs.Close
    
        
        
    'display result of calculation in txtvalue3 field
    Me.txtValue3 = SumValue1Value2
    
    'Requery bound field ?????????


End Sub

And the second button to reset it CmdReset;

Code:
Private Sub CmdReset_Click()
  
    'reset unbound application fields
    Me.txtValue1 = "0"
    Me.txtValue2 = "0"
    Me.txtValue3 = "0"
    
End Sub

I have this mdb loaded in a folder C:\Temp\Calculate

I am nearly there but stuck on this bound field....... :cool:

Any help would be appreciated.

Robert88
 

Attachments

Users who are viewing this thread

Back
Top Bottom