|
Subject:
|
click event for vb YesNo button
|
|
Posted By:
|
mohiddin52
|
Post Date:
|
1/12/2007 7:14:12 AM
|
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
|
|
Reply By:
|
stealthdevil
|
Reply Date:
|
1/12/2007 9:48:31 AM
|
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
|
|
Reply By:
|
mohiddin52
|
Reply Date:
|
1/14/2007 1:25:01 AM
|
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
|