Main form - sub form functionality (1 Viewer)

Georgemel

New member
Local time
Today, 05:16
Joined
Aug 14, 2019
Messages
8
Hi Everyone, I need some assistance with a VBA function that can assist me to pre-populate my subform with dates linked to a WeekNumber drop down in my main form. The sub form needs to be pre-populated as soon as I select the week number from the drop down and the user have to be able to still remove the dates they don't want so it cannot be linked to the main table. :banghead::banghead:
 

Minty

AWF VIP
Local time
Today, 12:16
Joined
Jul 26, 2013
Messages
10,355
Welcome to AWF!.

One method - In the sub form have a hidden field representing the week number of the date(s) you are displaying.

Make that the master child link field with the week number combo. You may need to add a year number to stop getting results from other years.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:16
Joined
May 7, 2009
Messages
19,175
sample for you to study.
 

Attachments

  • weekANDdays.zip
    30.2 KB · Views: 57

Georgemel

New member
Local time
Today, 05:16
Joined
Aug 14, 2019
Messages
8
Thanks Minty but I am not sure if it would work, see my image attached.
The top portion is part of the main table and the bottom is a sub form.

What I want to achieve is when I select the week in the main form the sub form creates the new records automatically for that week by default based on the selection made. (This info is stored in a table)

1. The user must be able to deleted days not required for the entry when required.
2. The user have to be able to insert additional dates as required.
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    94.7 KB · Views: 45

Georgemel

New member
Local time
Today, 05:16
Joined
Aug 14, 2019
Messages
8
Hi arnelgp, I have tried changing my db with what you did with the db you attached but I am doing something wrong with it. May I load my db on box for you as it is about 30mb in size.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:16
Joined
May 7, 2009
Messages
19,175
just make a trim version of your db.
include the form, the table or query that the form is using.
 

Georgemel

New member
Local time
Today, 05:16
Joined
Aug 14, 2019
Messages
8
I have trimmed it down.
 

Attachments

  • AMBCL.mdb
    1.8 MB · Views: 64

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:16
Joined
May 7, 2009
Messages
19,175
plz check and test.
 

Attachments

  • AMBCL.zip
    258 KB · Views: 63

Georgemel

New member
Local time
Today, 05:16
Joined
Aug 14, 2019
Messages
8
Thanks a Mil, this is working 100%
Thank you again for your assistance
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:16
Joined
May 7, 2009
Messages
19,175
you're welcome.
 

Georgemel

New member
Local time
Today, 05:16
Joined
Aug 14, 2019
Messages
8
Is there any way for me to get the dates inserted by using the default in WeekNo field?
 

Users who are viewing this thread

Top Bottom