Source Code:
Option Explicit
Public St as String
Option Explicit
…………………………………………………………………………………
Private Sub Form_Load( ) Me.txtData = “”
End Sub
………………………………………………………………………………..
Private Sub CmdAddDataToVariable_Click( ) If Me.txtData “” Then St = Me.txtData Else
MsgBox “Please, enter data in Text Box”, vbInformation, “Testing Standard Module” Me.txtData.SetFocus End If
End Sub
………………………………………………………………………………..
Private Sub CmdReadDataFromVariable_Click( ) MsgBox St
End Sub
………………………………………………………………………………..
Private Sub CmdShowFrom2_Click( ) From2.Show Unload Me
End Sub
……………………………….………………………………………………
Private Sub CmdExit_Click( ) End
End Sub
……………………………….………………………………………………
នៅក្នុង Form2 Module Source Code:
……………………………………………………………………………….
Private Sub Form_Load( ) Me.txtData = “” End Sub
………………………………………………………………………………...
Private Sub CmdAddDataToVariable_Click( ) St = Me.txtData End Sub
…………………………………………………………………………………
Private Sub CmdReadDataFromVariable_Click( ) MsgBox st, vbInformation, “Data Of variable’s st” End Sub
…………………………………………………………………………………
Private Sub CmdClose_Click() Unlaod Me End Sub
…………………………………………………………………………………
Private Sub CmdShowForm2_Click() Me.Hide Form1.Show vb Moduless End Sub
………………………………………………………………………………….
Source Code: Option Explicit
………………………………………………………………………………….
Private Sub Form_Load( ) Me.Lable1.Caption = “Value1” Me.Lable2.Caption = “Vlaue2” Me.txtValue1 = “” Me.txtValue2 = “” End Sub
…………………………………………………………………………………
Private Sub CmdTest_Click( ) If Me.txtValue1 > Me.txtValue2 Then MsgBox “The Value1 > Value2 “ End Sub
………………………………………………………………………………..
Source Code: Option Explicit
………………………………………………………………………………..
Private Sub Form_Load( ) Me.Lable1.Caption = “Value1” Me.Lable2.Caption = ‘Value2” Me.txtValue1 = “” Me.txtValue2 = “” End Sub