Beginner's doubt

  • Thread starter Thread starter Subenemi
  • Start date Start date
S

Subenemi

Hi all

I am not sure how clear I will be with this question, but I am giving
a try. I have a form, very simple one, which contains a sub form,
which is showing all records from a table in datasheet view.
I have also a combo box on the main form and I did not programmed
anything on it and when I change the combo box itself, the subform is
automatically change as well.
I have more experience with another languages but this seems to be a
mystery to me - where is the connection between the combo box on the
master form and the subform? As far as I know, it should change the
RecordSource, but I dont see the connection here so far.

Also, I would like to implement another filtering over the subform,
using a calendar control. Maybe if I got any clarification on the
first question, I can proceed by myself on this topic.

Can someone help me on this question? Thanks in advance!
 
Open the main form in design view.
Right-click the edge of the subform control, and choose Properies.

The LinkMasterFields property is probably referring to the combo, with the
LinkChildFields referring to the matching field in the subform. This would
cause Access to automatically reload the subform with the matching records
whenever the combo changes value.

Another possibility is that the subform's RecordSource is a query that
refers to the combo in its criteria, e.g:
[Forms].[Form1].[Combo0]
This is less likely, as you probably would not get the immediate change.

If neither of those apply, there may be some code in the combo's events -
typically Afterupdate. Here's an example of that:
http://allenbrowne.com/ser-03.html
 
Well... the only thing I saw was the RecordSet field with this query:

SELECT [systemStatus].[OU],
[systemStatus].[System],
[systemStatus].[SAP_Ini],
[systemStatus].[LoadBalancing],
[systemStatus].[IsApiArs_dll],
[systemStatus].[ILAserver_xxx_exe],
[systemStatus].[comment],
[systemStatus].[date]
FROM systemStatus;

i dont see criteria on the query...

And yes, there are no events on the combo box... What I did so far was
to use the wizard to build both forms and on the first one, I choose
the option to show the fields relating to the system field... I know
that there is where the tricks lay, but I would like to know how and
where to check it also

Open the main form in design view.
Right-click the edge of the subform control, and choose Properies.

The LinkMasterFields property is probably referring to the combo, with the
LinkChildFields referring to the matching field in the subform. This would
cause Access to automatically reload the subform with the matching records
whenever the combo changes value.

Another possibility is that the subform's RecordSource is a query that
refers to the combo in its criteria, e.g:
[Forms].[Form1].[Combo0]
This is less likely, as you probably would not get the immediate change.

If neither of those apply, there may be some code in the combo's events -
typically Afterupdate. Here's an example of that:
http://allenbrowne.com/ser-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




I am not sure how clear I will be with this question, but I am giving
a try. I have a form, very simple one, which contains a sub form,
which is showing all records from a table in datasheet view.
I have also a combo box on the main form and I did not programmed
anything on it and when I change the combo box itself, the subform is
automatically change as well.
I have more experience with another languages but this seems to be a
mystery to me - where is the connection between the combo box on the
master form and the subform? As far as I know, it should change the
RecordSource, but I dont see the connection here so far.
Also, I would like to implement another filtering over the subform,
using a calendar control. Maybe if I got any clarification on the
first question, I can proceed by myself on this topic.
Can someone help me on this question? Thanks in advance!
 
You looked at the properties of the form in the subform.

You need to look at the properties of the subform *control* that exists on
the main form.
 
True, now I can see the proper place. Indeed it is related to the
combo box. What I would like to know is how can I use two options to
relate this fields?
I was looking to change the query responsible for filling up the
subform (on the RecordSet value I just pasted above), but I didnt see
the criteria.

I want to use a calendar control (or anything else that the user could
click and select the date) together with the combo box.
 
I didn't follow that. If you want to learn more about how LinkMasterFields
and LinkChildFields work, see the help file in Access.
 
True, now I can see the proper place. Indeed it is related to the
combo box. What I would like to know is how can I use two options to
relate this fields?

You can use up to ten names, separated by semicolons, in the Master and Child
Link Field properties. For example, the Master Link Field could be

comboboxname;calendarcontrolname

and the child link field

IDfieldname;Datefieldname

The subform would then show those records with IDfieldname equal to the value
in the combo box, and datefieldname equal to the date selected in the calendar
control.
 
Back
Top