I have a form for all of our contacts.
It contains a subform of their donations, which I have been using in the datasheet view.
That works fine, except if I view a contact with many donations, I will see only as many donations as fit in the window. I would like to show them all, plus the open space in which an additional donation could be entered.
The goal is to show the user as much data as exists in the smallest space needed. This is because there are actually two subforms, and I would like the second one to be visible on the same screen when there are few subrecords.
I have changed the properties of the subform to make it a continuous form, because I understand that is necessary for this approach.
I found an example of code that is supposed to do what I want, on the microsoft forum, but I get a compile error, and I am not sure what to do about it. (I have very little experience with VBA).
The compiler seems to be having trouble with the second reference to "frmtblAppealDonationsSub" which is the name of the donations subform.
Here's the VBA I have so far
Private Sub Form_Resize()
On Error GoTo Form_Resize_Error
Me.frmtblAppealDonationsSub.Height = Me.InsideHeight - (Me.Section(1).Height + Me.frmtblAppealDonationsSub.Top + 100)
Me.frmtblAppealDonationSub.Width = Me.InsideWidth - 200
On Error GoTo 0
Exit Sub
Form_Resize_Error:
MsgBox "Error " & Err.Number & _
" (" & Err.Description & ") in procedure Form_Resize of VBA Document Form_frmMyQueryResults"
End Sub
It contains a subform of their donations, which I have been using in the datasheet view.
That works fine, except if I view a contact with many donations, I will see only as many donations as fit in the window. I would like to show them all, plus the open space in which an additional donation could be entered.
The goal is to show the user as much data as exists in the smallest space needed. This is because there are actually two subforms, and I would like the second one to be visible on the same screen when there are few subrecords.
I have changed the properties of the subform to make it a continuous form, because I understand that is necessary for this approach.
I found an example of code that is supposed to do what I want, on the microsoft forum, but I get a compile error, and I am not sure what to do about it. (I have very little experience with VBA).
The compiler seems to be having trouble with the second reference to "frmtblAppealDonationsSub" which is the name of the donations subform.
Here's the VBA I have so far
Private Sub Form_Resize()
On Error GoTo Form_Resize_Error
Me.frmtblAppealDonationsSub.Height = Me.InsideHeight - (Me.Section(1).Height + Me.frmtblAppealDonationsSub.Top + 100)
Me.frmtblAppealDonationSub.Width = Me.InsideWidth - 200
On Error GoTo 0
Exit Sub
Form_Resize_Error:
MsgBox "Error " & Err.Number & _
" (" & Err.Description & ") in procedure Form_Resize of VBA Document Form_frmMyQueryResults"
End Sub