473,387 Members | 1,619 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,387 software developers and data experts.

Copy date fields from one subform to another

I have a tabbed form with several subforms on the tabs. The database is an IT problem management database. The first tab has the information for the Failed Component, the thing that originally broke and made everything else go haywire. The Failed Component tab has a subform named fsubFailedComponent with the name of the failed component. FsubFailedComponent contains fsubFCImpact which is a continuous form that has all of the start and end times times for the failed component.
The next tab is for the various User Facing Applicaitions that were impacted by the failure of the Failed Component. It can have several applications, several locations and within the locations several business units. It has a subform named fsubUserFacingApps which is pretty much like fsubFailedComponent. It has the name of the application and a subform, fsubUFAImpact, with the detail info. My boss wants me to add a button to fsubUFAImpact that a user can click which will copy and paste the start and end times from fsubFCImpact tab to fsubUFAImpact, but still make it editable in case the impact started later or ended earlier.

Thanks!!
Nov 28 '06 #1
5 2627
MMcCarthy
14,534 Expert Mod 8TB
I have a tabbed form with several subforms on the tabs. The database is an IT problem management database. The first tab has the information for the Failed Component, the thing that originally broke and made everything else go haywire.

The Failed Component tab has a subform named fsubFailedComponent with the name of the failed component. FsubFailedComponent contains fsubFCImpact which is a continuous form that has all of the start and end times times for the failed component.

The next tab is for the various User Facing Applicaitions that were impacted by the failure of the Failed Component. It can have several applications, several locations and within the locations several business units.

It has a subform named fsubUserFacingApps which is pretty much like fsubFailedComponent. It has the name of the application and a subform, fsubUFAImpact, with the detail info.

My boss wants me to add a button to fsubUFAImpact that a user can click which will copy and paste the start and end times from fsubFCImpact tab to fsubUFAImpact, but still make it editable in case the impact started later or ended earlier.

Thanks!!
You will need something like the following code. Substitute your Main Form name for [MainFormName] and correct the names of the StartTime and EndTime fields and substitute your command button name for cmdButtonName.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub cmdButtonName_Click()
  3.  
  4.    Me.StartTime = [Forms]![MainFormName]![fsubFailedComponent].Form![fsubFCImpact].Form![StartTime]
  5.    Me.EndTime = [Forms]![MainFormName]![fsubFailedComponent].Form![fsubFCImpact].Form![EndTime]
  6.  
  7. End Sub
  8.  
Nov 28 '06 #2
Hi M,

I tried your solution which was similar to what I did before posting and got the same results. It doesn't seem to 'write' the copied dates to the table. I have a field which calculates the duration of the outage, it showed #ERROR when I did it at first, then when I tried your solution, it showed the same result it had when I hard coded my birthday in on a previous try. Then when I closed the form and reopened it on that record, the copied dates were gone. I'll try a requery or refresh and check back here again.

Thanks,

John
Nov 28 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Hi M,

I tried your solution which was similar to what I did before posting and got the same results. It doesn't seem to 'write' the copied dates to the table. I have a field which calculates the duration of the outage, it showed #ERROR when I did it at first, then when I tried your solution, it showed the same result it had when I hard coded my birthday in on a previous try. Then when I closed the form and reopened it on that record, the copied dates were gone. I'll try a requery or refresh and check back here again.

Thanks,

John
John

Have you set the control source of the controls to the appropriate fields?

Mary
Nov 28 '06 #4
John

Have you set the control source of the controls to the appropriate fields?

Mary
That was it!! I just noticed that for some reason the fields were unbound! I guess I inadvertantly did that while messing around with it before. Thanks for pointing me in the right direction Mary! It works like a charm now!
Nov 28 '06 #5
MMcCarthy
14,534 Expert Mod 8TB
Reason: chair to keyboard interface malfunction
I've had one of those before.

I sympathise

Mary
Nov 28 '06 #6

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

Similar topics

3
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
9
by: David Rysdam | last post by:
I have a large amount of data that I copy in and out of Sybase very often. Now I also want to copy this data in and out of postgres. I have an existing script that creates the entire database(s)...
1
by: Stephen D Cook | last post by:
I have a search form with a query-linked subform. One of the fields in the subform are date fields. Is there a way to autopopulate the DateFilled field when the person enters the field? I need...
2
by: Shawn Yates | last post by:
I have a form with two subforms on it which are both continous forms. The subform on the left shows the tasks that the employee was assigned to accomplish (each as a seperate record) while the one...
28
Ericks
by: Ericks | last post by:
I want to highlight new data that has been entered in my database since a last meeting so it is easy to see in a subform’s table what info is new. In my database I have a table called...
4
by: Mclaren | last post by:
Hi I have a main single record form that has a date field on it pupulated from primary table, i have subform (datasheet view) which is populated from the many table. the subform has a field that...
3
by: informankur | last post by:
Hi All, I am trying to create a form for updating values. I have a Table - ASP with Date, Product, Q1,Q2,Q3,Q4 fields. I have a Form ASP_Main with "Date" field for filtering by the date selected....
4
by: OzNet | last post by:
I have a form with a subform and I need to filter the records in the subform by dates. (Access 2007) The main form has two unbound text boxes called StartFilter and EndFilter. Both use the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.