RE: Arranging several forms (subforms)
- From: Rod Plastow <RodPlastow@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 28 Feb 2009 16:23:01 -0800
Hi Nicola,
Sorry, I did reply last Friday but when I posted the content it was reported
that I had lost contact with the server – timed out presumably. There is no
way that I could find of recovering my post! I then waited to see if it was
delayed in the system but unfortunately it seems I have to rewrite it.
I shall confine this response purely to pop-up modal forms and not attempt a
critique of your data design. No I did not mean that you cannot edit data
from pop-up forms; of course you can; they are no different from ordinary
forms, just displayed in a different way. However I would suggest you do not
allow any edits of the linking values.
Design your forms in the normal way but pay attention to the following
Property *** entries.
On the Data tab:
Make sure the Record Source is linked to a table or query to enable
automatic updating of your edits;
Set Data Entry to ‘No’ and Allow Edits and Allow Filters to ‘Yes.’ These
are the defaults.
I suggest you set Allow Additions to ‘No.’ Only set it to ‘Yes’ if the
pop-up form is based on separate, discrete table(s) from your main table
(i.e. typically displayed as a Continuous Form).
Similarly I suggest you set Allow Deletions to ‘No.’
On the Other tab:
You may set Pop Up and Modal to ‘Yes’ but you will set these values anyway
when you open the form.
On your main form include a Command Button for each and every pop-up form.
In the On Click event of each Command Button code something similar to the
following procedure. Don’t use the control wizard as this does not allow you
to specify linking criteria.
Private Sub Command1_Click()
Dim strCriteria As String
strCriteria = "IDCOURSE = " & Me.IDCOURSE & " AND IDPEOPLE = " &
Me.IDPEOPLE
DoCmd.OpenForm "Form1", , , strCriteria, , acDialog
End Sub
I can’t be exact because I do not know your requirements but I assume that
you are linking on course and person and that IDCOURSE and IDPEOPLE are
foreign keys in the table or query upon which your pop-up is based. I assume
these values are numeric.
I also assume you have columns in the underlying result set of your main
form named IDCOURSE and IDPEOPLE, hence Me.IDCOURSE and Me.IDPEOPLE. I also
assume these are numeric.
The DoCmd has three arguments of interest: the first is the name of your
pop-up form; the fourth is the linking/filtering clause which in this case is
encoded in a string variable; and the sixth that is an instruction to Access
to display the form as pop-up and modal.
Alter the foregoing according to your requirements and names and you should
be OK.
Rod
.
- Follow-Ups:
- Re: Arranging several forms (subforms)
- From: Defemex
- Re: Arranging several forms (subforms)
- Prev by Date: Re: TextBox Width
- Next by Date: Re: Two types of case statments
- Previous by thread: Re: TextBox Width
- Next by thread: Re: Arranging several forms (subforms)
- Index(es):