When you choose a year in the form fill in the right records (1 Viewer)

knoet

New member
Local time
Today, 18:06
Joined
Mar 5, 2020
Messages
16
I have a form, when you choose a year in the combobox, how to fill the right records in the form?
 

Attachments

  • Abo's.zip
    156.2 KB · Views: 19

mike60smart

Registered User.
Local time
Today, 17:06
Joined
Aug 6, 2017
Messages
1,913
I have a form, when you choose a year in the combobox, how to fill the right records in the form?
Hi

Your 1 table is not normalised as it contains Repeating Groups.

The fields listed below should be Records in a Related Table and not fields in this table.
USENET
USENETbegindatum
USENETeinddatum
USENETlogin
 

Attachments

  • Repeating Groups.png
    Repeating Groups.png
    22.3 KB · Views: 18

jdraw

Super Moderator
Staff member
Local time
Today, 12:06
Joined
Jan 23, 2006
Messages
15,379
knoet,

Can you step back and tell us a bit about your database application? Not only do current readers need some context in order to offer focused advice, but anyone reading this post in future would be "lost/confused" without some additional descriptive material.
What is/are "right records? Sometimes adding some detail to your post will help clarify things for you and readers.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:06
Joined
Feb 19, 2002
Messages
43,322
I agree with Mike, you need to rethink the table design and normalize it. That means that rather than the lovely column layout, you will have a list with each set of credentials on a separate row. But to make the form work:

1. Add an unbound control to the form's header. As the rowSource, create a query that selects Jaar from the table and group by it. That presents a list of the years.
2. Add a where clause to your form's RecordSource query. Where Jaar = Forms!FABOS!cboSearchJaar
3. In the Click event of the combo add a requery --- Me.Requery
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:06
Joined
May 7, 2009
Messages
19,247
you try this Abo
 

Attachments

  • Abo's.zip
    146.6 KB · Views: 28

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:06
Joined
Feb 19, 2002
Messages
43,322
@arnelgp You are always ready to jump in and do the changes for the poster which is very generous but sometimes it is better to just let the poster try to follow the explicit directions. Most people learn better by doing.

Also, you might want to fix your sample. You hid the bound year field so it won't be possible to add new records and as you scroll, you can't tell what record you are looking at.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:06
Joined
May 7, 2009
Messages
19,247
You hid the bound year field so it won't be possible to add new records and as you scroll,
the original form does not have the Year field on it, i just added it.
on the BeforeInsert event, i set the Year field to the value of the combo.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:06
Joined
Feb 19, 2002
Messages
43,322
You are justifying. The form is allowed to scroll. When you scroll, how can you tell what the year is?

Here's my version.
 

Attachments

  • abo's_Pat.zip
    68.6 KB · Views: 16
Last edited:

knoet

New member
Local time
Today, 18:06
Joined
Mar 5, 2020
Messages
16
Sorry, I just seen your answers, I never got a noticifation in my mail.
I wil study your anwers.
 

Users who are viewing this thread

Top Bottom