?
Solved

Access 2010

Posted on 2011-10-30
8
Medium Priority
?
157 Views
Last Modified: 2012-05-12
Hello
i have a database on access 2010 .  i want to create a button when i click on it it should add the value from one text field to other text field .

note : the two text field takes data from the a numbers tables .

how i can make it .

thanks alot
0
Comment
Question by:fadyabuzuaiter
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 44

Expert Comment

by:GRayL
ID: 37054551
are you in a form?
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 37055051
I assume that you have another unbound text field to capture the sum of the two fields. If my assumption is right, you may use the code below:

Private Sub cmdSum_Click()
Me.txtSum = Nz(Me.txtField1, 0) + Nz(Me.txtField2, 0)
End Sub

txtSum is the unbound field.

Sincerely,
Ed
0
 

Author Comment

by:fadyabuzuaiter
ID: 37058184
Hello
please check the attachment file
the form Student Form & the table name student .
i want to add a number to add account value then when i pressed the add buttom it should add it to the current account .


Student-DB.accdb
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37059016
Doing this with a button is awkward...

What if the use forgets?
What if the use clicks more than once...?

Doing this would also seem to create a "Hardcoded " value.

If It were me, I would create this "Calculated field" in the Recordsource and simply drop it into the form like any other field.
(This would also make it easy to have this value in the Report)

Modified sample attached
Student-DB.accdb
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 2000 total points
ID: 37063066
Use this code:

Private Sub Command45_Click()
Me.Balance = Me.Balance + Me.[last add]
End Sub

Ed
0
 

Author Comment

by:fadyabuzuaiter
ID: 37066918
THanks alot for your reply guys .
and there is a one problem still after the buttons work ..

i want to add a field for search in the Student form and it i want to make it when i type a letter it should give me the names with the starting with this letter .

in the attachment the last file modified .

Student-DB.accdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37067693
<i want to add a field for search in the Student form and it i want to make it when i type a letter it should give me the names with the starting with this letter . >

This appears to be a separate, new issue than the original question.
The rules of this site require one distinct question per post.

You should accept the post(s) that resolved your original issue as the solution here.
Then this new issue should be posted as a new question.

;-)

JeffCoachman
0
 

Author Comment

by:fadyabuzuaiter
ID: 37067869
ok thanks all for your reply
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question