Wow Melissa you sound busy lol.
In the main Database window click on tools - relationships from there add your tables create the relationship and set it to referential integrity then set cascade update and deletes.That should take care of any problems with corelating the records. If you want you can disable each control that is on the main form but that is about the only other thing you might consider. You will need some way to exit the subform and enable all the controls also so think about that before you attempt the following:
Dim ctl As Control
For Each ctl In frm.Controls
If not ctl.ControlType = 122 Then
ctl.Enabled = false
end if
Next
For resizing subforms I use the following and it works pretty good...
Can you explain about how to cascade updates and deletes? That sounds like good practice regardless of how the forms/subforms are displayed!
Dim ctl As Control
For Each ctl In frm.Controls
If not ctl.ControlType = 122 Then
ctl.Enabled = false
end if
Next
For resizing subforms I use the following and it works pretty good...
Code:
Private Sub Form_Resize()
On Error GoTo ResizeError
ResizeIt Me, Me!Hedging_subform, 300, 2800
Exit_Sub:
Exit Sub
ResizeError:
MsgBox Err.Number & " " & Err.Description
End Sub
Sub ResizeIt(myFrm As Form, mySubFrm As Control, X As Integer, Y As Integer)
On Error GoTo ResizeError
'Turn off screen redraw
Application.Echo False
If mySubFrm.Top + mySubFrm.Height + 100 <= ((myFrm.InsideHeight - mySubFrm.Top) - Y) Then 'myFrm.InsideHeight Then
If Y > 0 Then
mySubFrm.Height = ((myFrm.InsideHeight - mySubFrm.Top) - Y)
End If
myFrm.Section("DETail").Height = mySubFrm.Height
If X > 0 Then
mySubFrm.Width = myFrm.InsideWidth - X
End If
Else
If Y > 0 Then
If ((myFrm.InsideHeight - mySubFrm.Top) - Y) > 0 Then
mySubFrm.Height = ((myFrm.InsideHeight - mySubFrm.Top) - Y)
End If
End If
If X > 0 Then
mySubFrm.Width = myFrm.InsideWidth - X
End If
End If
'Turn screen redraw back on
Application.Echo True
Exit Sub
Exit_Sub:
Exit Sub
ResizeError:
' NB: Turn screen redraw back on if an error occurs!
Application.Echo True
MsgBox Err.Number & " " & Err.Description
End Sub
Comment