grey out subforms until main form fields entered?

Zarty

Registered User.
Local time
Today, 21:52
Joined
Jul 4, 2008
Messages
20
I have a MS Access 2003 app pointing to a SQL Server database. The main form has two subforms on it. The main form contains a few fields that, due to referential integrity rules, have to be completed before data can be entered into the subforms. From a db design point-of-view, this makes perfect sense. However, from a user point-of-view, a few testing issues have cropped up because they have tried to create a new record on the main form and, instead of entering the required fields on the main form they have gone straight to the subforms and tried to enter data on them - SQL Server fires off an error.

I realise the front-end design should take this into account and one way that should be possible is that, when a new main record is first created in Access, the two empty subforms should be greyed out or prevented from data entry in some other way. As soon as the required fields have been entered onto the main form, the subforms should be enabled to accept input. Hope this is clear? The two subforms should not become enabled until after the few required main form fields have been completed.

If I have not make the issue clear, please ask me to have another go at describing it.

Cheers,
Zarty
 
Ok, I've almost answered this question myself... In the 'Current' event of the form...

If Me.NewRecord Then
Me.subform.locked = True

I suppose I can use other events like 'after update' to unlock the subform(s).

Ideas still welcome.

Zarty
 
Ok, I have a working solution now. The subforms are disabled, not locked using 'Me.' Similarly enabled 'after update'.

Question... Is there a simple way to 'grey out' a subform? It'll still need disabling but greying out make it clear to the users.

Zarty
 

Users who are viewing this thread

Back
Top Bottom