[AccessD] Code help please

Steve Schapel miscellany at mvps.org
Sun Jul 1 22:35:25 CDT 2007


Hi Joe,

I think there are two approaches you could take here.

First approach...

Go to the design view of the table.  Set the Required property for all 
these fields to No.  Select 'Properties' from the View menu.  In the 
Validation Rule property, something like this...

([job title]="admin") Or ([Issueing agency] Is Not Null And [Licenseexp] 
Is Not Null And [dotExpdate] Is Not Null)

Validation Text property can be set as required.  This assumes no 
Default Values.

Second approach...

Code on the Before Update event of the form, for example...

  If Me.job_title <> "admin" Then
     If IsNull(Me.Issueing_agency + Me.Licenseexp + Me.dotExpdate) Then
        MsgBox "Some stuff missing"
     End If
  End If


Regards
Steve


Joe Hecht wrote:
> Hi all wise and mighty list.
> 
>  
> 
> A2k3
> 
>  
> 
> I have a field job title.
> 
>  
> 
> All job titles require license information unless job tile = admin
> 
>  
> 
> Silly me I set required in table rules.
> 
>  
> 
> I need some code that says something like
> 
>  
> 
> If job title  <> "admin" (string)
> 
>  
> 
> Then
> 
>  
> 
> Issueing agency .required = true
> 
> Licenseexp.required = true
> 
> dotExpdate.required =true
> 
>  
> 
> I do not see a .required property that I can set in code.
> 
>  
> 
> TIA
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Joe Hecht
> 
> jmhecht at earthlink.net
> 
>  
> 



More information about the AccessD mailing list