Kamis, 15 Agustus 2013

RE: [MS_AccessPros] Referencing form?

 

ROFL!

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Duane Hookom
Sent: Friday, 16 August 2013 09:19
To: Access Professionals Yahoo Group
Subject: RE: [MS_AccessPros] Referencing form?

Phucon,

Can we assume the change worked?

The last time I was called "Diane" was when our 9th grade school class
schedules were first determined by computer. I was placed in girls rather
than boys physical education class. It was an interesting year, especially
the lockerroom ;-)

Duane Hookom MVP
MS Access

----------------------------------------
> To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> From: saigonf7q5@yahoo.com <mailto:saigonf7q5%40yahoo.com>
> Date: Thu, 15 Aug 2013 20:51:48 +0000
> Subject: Re: [MS_AccessPros] Referencing form?
>
> Thank you Diane.
>
> --- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , Duane Hookom
<duanehookom@... <mailto:duanehookom@...> > wrote:
>>
>> Phucon,
>>
>> Assuming the form you are validating is the current form I think you need
to use:
>>
>> Private Sub Form_BeforeUpdate(Cancel As Integer)
>> Call ValidateData(Me)
>> End Sub
>>
>> Duane Hookom MVP
>> MS Access
>>
>> ----------------------------------------
>>> To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
>>> From: saigonf7q5@...
>>> Date: Thu, 15 Aug 2013 18:36:03 +0000
>>> Subject: [MS_AccessPros] Referencing form?
>>>
>>> Hello
>>> I have the procedures as shown below. If I enter the argument without
the "Form_" which is like this "frmPshowData". It will generate a "variable
not defined" error.
>>>
>>> When is it necessary to include the "Form_" and when it's not? e.g.
Form_frmPShowData, frmPShowData.
>>>
>>> Another question that I have is, when a user left a require field blank,
in this case, a date. How do I keep the user from closing or exit out the
form without entering the correct data?
>>>
>>> Thank you
>>> Phucon
>>>
>>> Private Sub Form_BeforeUpdate(Cancel As Integer)
>>> Call ValidateData(Form_frmPShowData)
>>> End Sub
>>>
>>> Public Sub ValidateData(Frm As Form)
>>> On Error GoTo ErrorHandler
>>>
>>> Select Case txtVData
>>> Case "Yes"
>>> Frm!txtVDate.Enabled = True
>>> If Frm!txtVDate & "" = "" Then
>>> MsgBox "Please enter a date.", vbExclamation, "Invalid data"
>>> Frm!txtVDate.SetFocus
>>> End If
>>> Case "No"
>>> Frm!txtVDate.Enabled = False
>>> Case Else
>>> MsgBox "Enter ""Yes"" or ""No"" only", vbExclamation, "Invalid Data"
>>> End Select
>>>
>>> ExitProcedure:
>>> On Error Resume Next
>>> Exit Sub
>>>
>>> ErrorHandler:
>>> MsgBox Err.Number & vbCrLf & Err.Description
>>> Resume ExitProcedure
>>> Resume
>>> End Sub
>>>
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar