Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-14-2019, 12:18 AM   #1
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Unhappy Main form - sub form functionality

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.

Georgemel is offline   Reply With Quote
Old 08-14-2019, 12:22 AM   #2
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,336
Thanks: 158
Thanked 1,699 Times in 1,670 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Main form - sub form functionality

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.
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 08-14-2019, 02:14 AM   #3
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,599
Thanks: 59
Thanked 2,435 Times in 2,335 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Main form - sub form functionality

sample for you to study.
Attached Files
File Type: zip weekANDdays.zip (30.2 KB, 4 views)

__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
Old 08-14-2019, 02:15 AM   #4
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Re: Main form - sub form functionality

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.
Attached Images
File Type: jpg Untitled-1.jpg (94.7 KB, 8 views)
Georgemel is offline   Reply With Quote
Old 08-14-2019, 02:18 AM   #5
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Re: Main form - sub form functionality

Thanks arnelgp this is exactly what I was looking for
Georgemel is offline   Reply With Quote
Old 08-15-2019, 11:24 PM   #6
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Re: Main form - sub form functionality

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.
Georgemel is offline   Reply With Quote
Old 08-15-2019, 11:47 PM   #7
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,599
Thanks: 59
Thanked 2,435 Times in 2,335 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Main form - sub form functionality

just make a trim version of your db.
include the form, the table or query that the form is using.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
Old 08-16-2019, 12:01 AM   #8
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Re: Main form - sub form functionality

I have trimmed it down.
Attached Files
File Type: mdb AMBCL.mdb (1.84 MB, 2 views)
Georgemel is offline   Reply With Quote
Old 08-16-2019, 01:09 AM   #9
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,599
Thanks: 59
Thanked 2,435 Times in 2,335 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Main form - sub form functionality

plz check and test.
Attached Files
File Type: zip AMBCL.zip (258.0 KB, 3 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
Old 08-16-2019, 01:39 AM   #10
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Re: Main form - sub form functionality

Thanks a Mil, this is working 100%
Thank you again for your assistance
Georgemel is offline   Reply With Quote
Old 08-16-2019, 01:51 AM   #11
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,599
Thanks: 59
Thanked 2,435 Times in 2,335 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Main form - sub form functionality

you're welcome.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
Old 08-16-2019, 02:23 AM   #12
Georgemel
Newly Registered User
 
Join Date: Aug 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Georgemel is on a distinguished road
Re: Main form - sub form functionality

Is there any way for me to get the dates inserted by using the default in WeekNo field?

Georgemel is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Functionality Update SamBuff Forms 3 05-10-2014 06:41 PM
Search form additional functionality west General 2 12-17-2013 12:57 PM
Add Query Functionality to Existing Form aball65 Forms 7 07-26-2009 11:35 PM
Main Form Secondary Main Form Subform Issue rdodson Forms 1 10-16-2008 03:14 PM
Why is main form Update event triggered when subform dirties main form? bluegno Forms 2 12-01-2005 09:24 AM




All times are GMT -8. The time now is 02:54 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World