C Caddie Registered User. Local time Today, 03:06 Joined Feb 16, 2010 Messages 75 Feb 18, 2010 #1 Hi - I have a main form with a subform which has a subform in it. I'd like to make so a user cannot enter data into a child form without completing the parent form first. How would I go about doing this? Thanks.
Hi - I have a main form with a subform which has a subform in it. I'd like to make so a user cannot enter data into a child form without completing the parent form first. How would I go about doing this? Thanks.
HiTechCoach Well-known member Local time Today, 05:06 Joined Mar 6, 2006 Messages 4,357 Feb 18, 2010 #2 Caddie said: Hi - I have a main form with a subform which has a subform in it. I'd like to make so a user cannot enter data into a child form without completing the parent form first. How would I go about doing this? Thanks. Click to expand... Try locking the sub form until the parent form has been saved.
Caddie said: Hi - I have a main form with a subform which has a subform in it. I'd like to make so a user cannot enter data into a child form without completing the parent form first. How would I go about doing this? Thanks. Click to expand... Try locking the sub form until the parent form has been saved.
C Caddie Registered User. Local time Today, 03:06 Joined Feb 16, 2010 Messages 75 Feb 18, 2010 #3 Sorry but, how do you do that?
L LinusIT Registered User. Local time Today, 11:06 Joined Jan 30, 2010 Messages 20 Feb 18, 2010 #4 On your subform set enabled = no using the form properties then using VBA somewhere through your parent form, use: Me.objectname.Enabled = True
On your subform set enabled = no using the form properties then using VBA somewhere through your parent form, use: Me.objectname.Enabled = True
HiTechCoach Well-known member Local time Today, 05:06 Joined Mar 6, 2006 Messages 4,357 Feb 19, 2010 #5 I would use the parent forms' On Current event like this: Assuming the sub form contol's name is sfMySubForm Code: Private Sub Form_Current() Me.sfMySubForm.Locked = Me.NewRecord End Sub or is Longhand code: Code: Private Sub Form_Current() If Me.NewRecord = True Then Me.sfMySubForm.Locked = True Else Me.sfMySubForm.Locked = False End If End Sub Use the Parent form's After update event like this: Code: Private Sub Form_AfterUpdate() Me.sfMySubForm.Locked = False End Sub
I would use the parent forms' On Current event like this: Assuming the sub form contol's name is sfMySubForm Code: Private Sub Form_Current() Me.sfMySubForm.Locked = Me.NewRecord End Sub or is Longhand code: Code: Private Sub Form_Current() If Me.NewRecord = True Then Me.sfMySubForm.Locked = True Else Me.sfMySubForm.Locked = False End If End Sub Use the Parent form's After update event like this: Code: Private Sub Form_AfterUpdate() Me.sfMySubForm.Locked = False End Sub
C Caddie Registered User. Local time Today, 03:06 Joined Feb 16, 2010 Messages 75 Feb 19, 2010 #6 Works perfectly, thanks!
C Caddie Registered User. Local time Today, 03:06 Joined Feb 16, 2010 Messages 75 Feb 19, 2010 #7 This seems to work however it is messing with my tab orders for some reason. Any ideas why this would happen?
This seems to work however it is messing with my tab orders for some reason. Any ideas why this would happen?
HiTechCoach Well-known member Local time Today, 05:06 Joined Mar 6, 2006 Messages 4,357 Feb 19, 2010 #8 Caddie said: This seems to work however it is messing with my tab orders for some reason. Any ideas why this would happen? Click to expand... Unless you are using code to set the focus or move to a control in the, it is using the default method.
Caddie said: This seems to work however it is messing with my tab orders for some reason. Any ideas why this would happen? Click to expand... Unless you are using code to set the focus or move to a control in the, it is using the default method.