473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Updating Mainform(SubForm1 from (SubForm2) )

11
Your Question was:

Hi there, I have a small Problem which I cannot resolve and am wondering if you could help me. Basically I have 3 Forms Names ClientForm/VehicleForm & JobForm.the MainForm is ClientForm which has the VehicleForm embedded as a SubForm of ClientForm.the embeded VehicleForm also has an Embedded form called JobForm. All forms are updated in order from Left to Right ClientForm>VehicleForm>JobForm.

See Attached image for Clearer image.

I can access the controls on the VehicleForm from within the JobForm using: Forms!VehicleForm!VehicleControl no problems however When trying to Access the VehicleForm from the JobForm whilst embedded into the ClientForm the Following does NOT work:
Forms!ClientForm!VehicleForm!VehicleControl , likewise as advised at the below site:
MVPS.ORG

I have tried:
Forms!Mainform!Subform1.Form!ControlName which Proceeds to give me an Error which states "cannot find FIELD SubForm1" ?

Hopefully you could help me with this .

Kind Regards

Weise

Jun 15 '10 #1

✓ answered by TheSmileyCoder

Looking at your database, I can see that the control containing the vehicle form is named vehicleTable, just like I suspected and took the time to explain in my first post.

Changed the line of code to:
Expand|Select|Wrap|Line Numbers
  1. Forms!ClientForm!VehicleTable.Form!VehicleWarrantExp = DateAdd("m", [WarrantTerm], [NewWarrantDate])
and it worked.

If your looking for help, you should at least take the time to read the replies people make.

4 1994
TheSmileyCoder
2,322 Expert Mod 2GB
Im not exactly sure why it isn't working. Your sure the CONTROL containing your subform is named SubForm1?

A form has a name regardless of whether its used as a form or a subform, thats the name you see in the Database explorer window (Don't really know if its called such). When you embed a form into another form, the subform is contained in a control, which can be named differently from the name of the form. Make sure your using the name of the control, not the name of the form.
Another approach that can be used:
Expand|Select|Wrap|Line Numbers
  1. Me.Parent.Form.VehicleWarrantExp=Me.NextWarrentDate
Or:
Expand|Select|Wrap|Line Numbers
  1. Docmd.Setwarnings False
  2.   Docmd.RunSQL "UPDATE tbl_Vehicles " & _
  3.                "SET VehicleWarrantExp=#" & Me.NextWarrentDate & "# " & _
  4.                " WHERE KEY_Vehicle=" & Me.VehicleID"
  5. Docmd.SetWarnings True
Something I can't help but notice since I am looking at it, is why do you have the VehicleID as a dropdown in your Job-subform? The Job-Subform is a subform of teh Vehicle, and as such should be related directly to the vehicle, through the subform binding.
Jun 15 '10 #2
Weise
11
Hello SmileyOne :D, Thank you for your help on this one I Greatly Appreciate it.
and for your efforts I do not mind sharing this Database with this forum to help others in the same predicament as myself.

if you open the database and run the VehicleForm then update the NewWarrantDate field the NextwarrantDue field will be automatically updated afterwhich clicking on the [update] button transfers the NewWarrantDate over to the vehicle Form updating this information. However it does not work at all When loaded through the ClientForm as you will see.

Regarding the VehicleID you are correct this does not need to be a combobox and will be changed to a TBox.

thank you for your time and efforts in assisting me.

much appreciated.

Weise.
Attached Files
File Type: zip TGF1.zip (158.7 KB, 78 views)
Jun 15 '10 #3
TheSmileyCoder
2,322 Expert Mod 2GB
Looking at your database, I can see that the control containing the vehicle form is named vehicleTable, just like I suspected and took the time to explain in my first post.

Changed the line of code to:
Expand|Select|Wrap|Line Numbers
  1. Forms!ClientForm!VehicleTable.Form!VehicleWarrantExp = DateAdd("m", [WarrantTerm], [NewWarrantDate])
and it worked.

If your looking for help, you should at least take the time to read the replies people make.
Jun 15 '10 #4
Weise
11
Sorry M8 , was late last night and I had read your post but was adamant that I had the right Control :| Thank you.
Jun 15 '10 #5

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

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
2
by: Hal Vaughan | last post by:
First, I am aware of both SwingUtilities.invokeLater(), and of using Thread to create a new thread.  These are part of the problem. I want to have something running in the background, while the...
45
by: It's me | last post by:
I am new to the Python language. How do I do something like this: I know that a = 3 y = "a" print eval(y)
6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
14
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
6
by: muttu2244 | last post by:
hi all am updating the same file in ftp, through multiple clients, but am scared that two clients may open the same file at a time, and try updating, then the data updated by one data will be...
4
by: Wout | last post by:
Hello there, i have a main form to define products in. i have a subform1 to fill in the related materials i have a subform2 to fill in the machines to process the materials subform1 is...
0
by: =?Utf-8?B?YmFrZXJzaGFjaw==?= | last post by:
Unless my app is EXTREMELY simple, I get the cross-threading error message regularly when updating controls on a Windows form. My latest example involves a dll that runs a System.Threading.Timer,...
5
by: rosaryshop | last post by:
I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php. As the user makes selections, it updates images of various parts, giving them a preview of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.