By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

restricting sub forms for a dummy

P: 1
looking for a BASIC way of only allowing data entry into two sub form once fields in the main form are completed. NOVICE HERE.
Oct 15 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
You could default the subforms locked property to Yes. Then create a trigger to unlock them. Something like a command button which will first check that there is data in all the controls.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub CommandBtn_Click()
  3.  
  4.     If IsNull(Me.Control1) Then
  5.         Msgbox "You must put data in Control 1 first", vbOKOnly
  6.     ElseIf IsNull(Me.Control2) Then
  7.         'And so on
  8.     Else
  9.         Forms!Subform1Name.Form.Locked = "No"
  10.         Forms!Subform2Name.Form.Locked = "No"
  11.     End If
  12.  
  13. End Sub
  14.  
looking for a BASIC way of only allowing data entry into two sub form once fields in the main form are completed. NOVICE HERE.
Oct 15 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.