Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2007, 08:14 AM
Authorized User
 
Join Date: Dec 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default click event for vb YesNo button

Hi all
I have create two one table Emp_Mstr there are Name, Pay, Loan another table Emp_Loan like Name,Pay,Loan,Balance and my form is frmEmp it related with my table Emp_Mstr in my form there are txtName, txtPay, txtLoan, txtBalance fields in txtBalance control source =[txtPay]-[txtLoan] Now problems is in my form one command button like cmdPro when I click the button I write the code like below
Private Sub cmdPro_Click()
Dim MPay As Double
Dim MLoan As Double
Mpay=Me.txtPay
MLoan=Me.txtLoan
m = MsgBox("Do you want to process?", vbYesNo”)
Now I want when I click ‘yes’ I want to insert into all above another table Emp_Loan
Remaining how should write the code click the yes button



Mohamed Mohiddin
Officer
__________________
Mohamed Mohiddin
Officer
 
Old January 12th, 2007, 10:48 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

    Here's some code I've used for the YesNO.

Dim sMsg, sResponse, sButton, sTitle As String

    sMsg = "BreakPoints must be correct before Filling."
    sButton = vbYesNo + vbQuestion + vbDefaultButton2
    sTitle = "Are BreakPoints Correct?"

    sResponse = MsgBox(sMsg, sButton, sTitle)
    If sResponse = vbYes Then
        Call fourhigh
        Call set4locs
        DoCmd.OpenForm "F_os_rev"
    End If

 
Old January 14th, 2007, 02:25 AM
Authorized User
 
Join Date: Dec 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your replay, but actually I want when I click the yes button I want to append the both record txtName, txtPay, txtBalance,txtAOI from frmEmp into my another table Emp_Loan

Mohamed Mohiddin
Officer





Similar Threads
Thread Thread Starter Forum Replies Last Post
enter key should execute button click event MunishBhatia ASP.NET 2.0 Professional 6 November 25th, 2007 10:59 PM
Button Click Event via XML,XSLT,javascript rhd110 XML 2 June 20th, 2007 08:16 AM
Link button click event sarah lee ASP.NET 2.0 Basics 5 May 18th, 2007 09:29 AM
Input button click event not working Scott Rider General .NET 3 August 13th, 2005 12:20 PM
Trigger event on button click speedyH ASP.NET 1.x and 2.0 Application Design 3 June 27th, 2004 10:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.