Open Event

14 May

From:    “Sofyan Efendi” <opi@softhome.net>
Date:    Wed, 23 Aug 2006 14:25:39 +0700

Event Open terjadi saat form terbuka pertama kali, namun sebelum record yang pertama ditampilkan. Untuk report, event ini terjadi sebelum report tampil dalam bentuk print preview. Syntax:

Private Sub object_Open( Cancel As Integer)

Penjelasan:

– Object: Nama Form atau Report.

– Cancel: Jika diset True, maka akan meng-cancel event ini.

Ketika kita membuka suatu form, maka urutan event nya adalah sbb:

Open -> Load -> Resize -> Activate -> Current

Ketika kita menutup suatu form, maka urutan event nya adalah sbb:

Unload -> Deactivate -> Close

Contoh:

Private Sub Form_Open(Cancel As Integer)
Dim intReturn As Integer
intReturn = MsgBox(“Enter order details now?”, vbYesNo)
Select Case intReturn
Case vbYes
‘ Open Order Details form.
DoCmd.OpenForm “Order Details”
Case vbNo
MsgBox “Remember to enter order details by 5 P.M.”
Cancel = True ‘ Cancel Open event.
End Select
End Sub

Wassalaamu’alaikum Warahmatullahi Wabarakatuh,
Sofyan Efendi
– AccessWeb <http://www35.websamba.com/accessweb&gt;
– OPI-Homepage <http://www.geocities.com/opi1978&gt;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: