Creating Message Box in the FORM of MS Access 2002

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Creating Message Box in the FORM of MS Access 2002

Post 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.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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.
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Creating Message Box in the FORM of MS Access 2002

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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/
Post Reply