473,503 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I set a subform field equal to an unbound parent field?

5 New Member
I am creating a data-entry form with several steps to make sure the user puts things in a particular way and I'm having some issues I am hoping somebody can help with.

1. Form # 1 - fromTruckCollection
Unbound form. Requires the user to enter 3 pieces of information and will not let them move to the data-entry table without this information. This form works perfect.
1. Truck Number
2. Route Fill ID
3. Collection Date
I get the three things I need form the user, above, then the form opens the new form and passes the information to the new form (frmCollection) as a string.

2. Form 2 - frmCollection
I use OpenArgs to take the string from the first form apart into usable information I need for my data entry in this form.

Private Sub Form_Open(Cancel as Integer)
Dim Truck, WeekDay, CollectionDate
Truck = Split(Me.OpenArgs, ";")(0)
WeekDay = Split(Me.OpenArgs, ";")(1)
CollectionDate = Split(Me.OpenArgs, ";")(2)

DateValue(CollectionDate)

End Sub

I know the information is coming across correctly because I'm able to use Truck and WeekDay to run a query on open that pulls up all the correct information the end-user needs for data entry.

Here's the issue. The CollectionDate is not use in frmCollection. It's actually a value that I need to save in the subform frmCollectionsubform.

Because CollectionDate is not an actual bound field on frmCollection I cannot seem to get the DateValue of Collection Date from the Parent form, frmCollection, to the Subform, frmCollectionsubform.

Actually, I take that back. I was able to get it to work one time, but it didn't actually save the value in the subform, I was simply displaying what was in the very first form, frmTruckCollection. However, I really need to save the date in the subform. The reason I'm trying to do this is because the exact same date gets entered for all the data-entry the user is doing. It could be 32 records, it could be 15. So I'm trying to save the data-entry use some time.

I hope I've explained this correctly. I appreciate any help anyone can offer. Thank you.
Aug 3 '17 #1
5 3120
jimatqsi
1,271 Recognized Expert Top Contributor
Maybe there's an issue with how you are setting up the OpenArgs. But you don't really need to do that if there is a form/subform relationship. In the subform you can refer to me.parent.fieldname to get the value of any field in the parent form.

Jim
Aug 5 '17 #2
wmix
5 New Member
Thanks for replying Jim. Yes, I thought that it should work also, but I'm thinking it's because my parent form doesn't actually have the CollectionDate field on it. The parent form pulls a query that selects the vending machines that we are entering the information for, it's not a table where the information is going. Does that make sense?
Aug 11 '17 #3
NeoPa
32,557 Recognized Expert Moderator MVP
Referring to a field, rather than a control, is at least very complicated. If you need the data available then using a bound control is much more straightforward.
Aug 11 '17 #4
wmix
5 New Member
Thanks NeoPa, you're correct. In my quest to make the end-user experience as easy as possible I'm driving myself crazy.

I can leave the CollectionDate blank and force the user to enter the exact same date in the subform for every record, it just so much repetitive information.
Aug 14 '17 #5
NeoPa
32,557 Recognized Expert Moderator MVP
I'm not saying you can't (and certainly not that you shouldn't) refer to that information. Simply that you'll find it a lot easier to do if you ensure you have a Control set up with the information in rather than relying on getting to the data source field directly.

I would encourage you to use your skills and imagination to ensure the system works as smoothly and comfortably for the user as you can. This can reduce errors as well as leaving the customer happier. What's not to like.
Aug 15 '17 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4709
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text box that references a field on the subform. What I'd like it to do is show the value...
2
9746
by: Gary T. | last post by:
I have a subform (that is linked to a table) in a blank form. When the table is viewed in its subform state in the form, the headings are not user friendly. ie. CustN I would want it to read in...
6
1877
by: abbylee26 | last post by:
Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData This will work when comparing other fields...
1
4325
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
5
1773
by: z.ghulam | last post by:
Hi, I have a subform in a main form. When I create new records in the subform I would like the Subform. to autofill with the MainForm. It sounds quite simple, but ive been bustin my brains...
6
2960
by: naschol | last post by:
I am somewhat of a novice and am trying to do a somewhat complicated thing (to me, anyway). What I would like to do is populate the field Entry Fee in the subform (Category Entries table) from a...
2
2630
by: benmanns | last post by:
Sorry if this has been posted before; I am not sure what to search for. I have a table of users, `users`. In the table `users` there is a row which stores clicks, `users`.`clicks`. Each user has...
4
2024
by: trixxnixon | last post by:
i have a field on a form where a calculation is displayed. The field calculates the number of business days a request is due based on a priority level chosen from a drop down box. i want to save...
5
6230
by: hbaf208 | last post by:
I have a combobox on a subform that is based on an SQL that uses a listbox on the unbound parent form as the criteria. When the form is first loaded, it works perfectly, limiting the dropdowns to...
2
2003
by: Corwin Moyne | last post by:
I have 2 tables (amongst others). The parent table is called tbl_JobReferences and the other is called tbl_Colours. The database is used to store the quantity of printing plates in stock. When a...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.