[AccessD] Check Subform for NotNull

Andy Lacey andy at minstersystems.co.uk
Tue May 29 14:27:01 CDT 2007


Hi Virginia
How about this? Set form to AllowAdditions but not AllowEdits. Then put a
button on the main form, labelled 'Unlock' or something. The code behind
button would be:

Forms!frm_InventoryMain.frm_InventorySubform.Form.AllowEdits=True

then somewhere like the Form's AfterUpdate for the subform you can

Forms!frm_InventoryMain.frm_InventorySubform.Form.AllowEdits=False

to stop further editing.

But you'll have to think about what's to stop anyone clicking the button.
Does everyone signon to the system? Could you only make the button visible
if someone's security allows it?

-- Andy Lacey
http://www.minstersystems.co.uk 

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> Hollis, Virginia
> Sent: 29 May 2007 14:42
> To: accessD at databaseadvisors.com
> Subject: [AccessD] Check Subform for NotNull
> 
> 
> I have a form and a subform where the users want the subform 
> locked if a record has been entered. They do not want it to 
> be changed once data has been entered. They can add new 
> records, just not edit existing records.
> 
>  
> 
> Then I have the problem - 'what if they make a typo' and 
> discover it after the record has been entered and locked. 
> They only want a supervisor to be able to go back, unlock the 
> record on the subform and make the change.
> 
>  
> 
> I tried the below code OnOpen of the Main form, but receive an error.
> 
>  
> 
>     If
> IsNotNull(Forms!frm_InventoryMain.frm_InventorySubform.Invento
> ryID) Then
> 
>         Forms!frm_InventoryMain.frm.InventorySubform.Form = Locked
> 
>     Else    
> 
>  
> 
>     End If
> 
>  
> 
> Virginia
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 





More information about the AccessD mailing list