Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-15-2019, 05:51 AM   #1
aman
Newly Registered User
 
Join Date: Oct 2008
Posts: 1,250
Thanks: 54
Thanked 3 Times in 2 Posts
aman is an unknown quantity at this point
Sub form to store value from the form

Hi guys,

I have been trying to resolve the issue but no luck . I have a form and there is a sunform within it . So I want to store the value of ‘DocCheckId’ text box from the form to ‘FormRef’ within subform. It is storing 0 for each entry in the sub form at the moment .

Any help will be much appreciated .

Thanks

aman is offline   Reply With Quote
Old 03-15-2019, 05:57 AM   #2
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,437
Thanks: 166
Thanked 1,738 Times in 1,707 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Sub form to store value from the form

Is FormRef the child Foreign Key for the DocCheckID pk in the main form data?

Is so simply set it to the Link child Field in the subform container to FormRef and the Link Master Field to DocCheckID
__________________
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 03-15-2019, 06:28 AM   #3
aman
Newly Registered User
 
Join Date: Oct 2008
Posts: 1,250
Thanks: 54
Thanked 3 Times in 2 Posts
aman is an unknown quantity at this point
Re: Sub form to store value from the form

I have defined master child relationship but it's still showing 0 value for each 'FormRef'.

My subform is bound and linked to a table 'tblQARemedial' but my form is unbound so when the user selects 1st control then data gets saved down in master table and it gives unique reference number (this one I am using in master field and the child is linked to 'FormRef')

Thanks

aman is offline   Reply With Quote
Old 03-15-2019, 06:46 AM   #4
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,437
Thanks: 166
Thanked 1,738 Times in 1,707 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Sub form to store value from the form

Try setting the subform to Filter On Empty Master property to yes to hide the subform when there is no matching record?
__________________
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 03-15-2019, 06:47 AM   #5
aman
Newly Registered User
 
Join Date: Oct 2008
Posts: 1,250
Thanks: 54
Thanked 3 Times in 2 Posts
aman is an unknown quantity at this point
Re: Sub form to store value from the form

It's already set to Yes.
aman is offline   Reply With Quote
Old 03-15-2019, 06:58 AM   #6
aman
Newly Registered User
 
Join Date: Oct 2008
Posts: 1,250
Thanks: 54
Thanked 3 Times in 2 Posts
aman is an unknown quantity at this point
Re: Sub form to store value from the form

So what's happening is that it gives me the right reference in 'FormRef' in the subform but as the subform is continuous so when the focus is moved to the next record then 'FormRef' in the first record goes disappeared.
aman is offline   Reply With Quote
Old 03-15-2019, 11:03 AM   #7
Cronk
Newly Registered User
 
Join Date: Jul 2013
Posts: 2,162
Thanks: 3
Thanked 471 Times in 464 Posts
Cronk will become famous soon enough Cronk will become famous soon enough
Re: Sub form to store value from the form

If the parent form is unbound, what are you using as the master field in the link relationship?

Cronk is offline   Reply With Quote
Old 03-15-2019, 12:21 PM   #8
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 2,112
Thanks: 20
Thanked 400 Times in 393 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: Sub form to store value from the form

Please let me know if this clarified exactly what you want to happen:
You have an unbound form.
On your unbound form, you have a subform to show records. When you make a change to an unbound control on your form you want to update all records shown in the subform?

If this is the case, you would need to have an update query (or similar) to go ahead and do the actual work of updating the records in the table.

Mark_ 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
Store Value of Text Box on Form after Form is Closed bconner Modules & VBA 2 02-17-2011 06:18 AM
form to store notes Mike Hughes Forms 1 02-28-2009 09:27 AM
Store value from form in table flavioso Tables 7 11-05-2008 11:36 AM
Store Value to (TABLE) from (FORM) vip2442 Forms 2 03-22-2005 02:09 PM
store a value from a form to a lookup table soundsfishy Forms 2 08-26-2003 04:24 PM




All times are GMT -8. The time now is 01:07 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