Page 1 of 1

Creating Message Box in the FORM of MS Access 2002

Posted: Mon Jul 05, 2004 1:22 pm
by szms
How to creat a message box in a form of MS Access 2002 so that if I hit a button (Suppose Delete), a message box will pop up and ask: Are you sure whether you want to delete this information. "Yes" or "No".

Any related information will be appriciated. Thank you.

Posted: Mon Jul 05, 2004 1:33 pm
by patrikG
In Javascript you simply use:

Code: Select all

if(confirm("Are you sure whether you want to delete this information?")){
...
}
If you specifically want to have "yes" or "no" you'd have to make a layer (with <div>) and, so that the background in IE doesn't "shine" through, have in iframe in that layer containing the necessary code.

For MS Access - no idea.

Creating Message Box in the FORM of MS Access 2002

Posted: Tue Jul 06, 2004 8:00 am
by szms
How to create a message box in a form of MS Access 2002 so that if I hit a button (Suppose Delete), a message box will pop up and ask: Are you sure whether you want to delete this information. "Yes" or "No".

I have the following code for deleting record from the table. I am a new Access Programmer and not yet very familier with VB code for manipulating different fitures. It would be great if you tell me where exactly I should put your code. Thank you very much.

Code: Select all

Option Compare Database

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click


DoCmd.RunSQL "DELETE FROM Member_Name WHERE &#1111;First_Name]='" & &#1111;FirstName] & "';"

&#1111;FirstName] = ""

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub

Private Sub Detail_Click()

End Sub


feyd | added

Code: Select all

tag[/color]

Posted: Tue Jul 06, 2004 9:41 am
by feyd
As for VB, you should probably check MSDN: http://msdn.microsoft.com/library/en-us ... eBoxes.asp
or look through the main page: http://msdn.microsoft.com/library/