473,320 Members | 2,020 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,320 software developers and data experts.

Loop Subform

Hello guys

This is my first post here, I'm trying to build inventory database and i stacked in something

I have main form "Voucher" and Continuous Subform "InventoryTransactionsSubform" are bounded with 2 tables

There is field "CreationDate" in the main form and
Field "created Date" in the subform

I need when i change "CreationDate" in main from loop and change all the fields of "Created Date" of all records in the sub

Link Master Fields is ID (AutoNumber)
Link Child Fields is VoucherNo (Number)

Thanks in Advance
Dec 4 '15 #1
5 2159
zmbd
5,501 Expert Mod 4TB
mohroshdy:
Your question isn't very clear.
Please try again. Maybe give a little example of what you are trying to accomplish.

There is field "CreationDate" in the main form and
Field "created Date" in the subform
One does not normally store the same information twice in properly normalized/designed database, this may answer your question:
home > topics > microsoft access / vba > insights > database normalization and table structures
Dec 4 '15 #2
Thanks Mr. zmbd for your answer, I will make my question clear for you

I have 2 tables
1- table is "Voucher", has field "CreationDate"
2- table is "InventoryTransactions", has field "Created Date"

I have 2 forms
1- "Voucher" main form which is bounded to "Voucher" table
2- "InventoryTransactionsSubform" which is bounded to "InventoryTransactions" table

I need when I update the field "CreationDate" in main form, the field "Created Date" will change in subform for all records to be the same.

any idea...
Dec 4 '15 #3
jforbes
1,107 Expert 1GB
I agree with zmbd that this might not be best option for your situation and maybe clarification might help.

Often people will want to know the date a record changes and this might be what you are after, But usually something like this is done on record by record case and not the whole set. If this is the case and you are running Access 2010 and later, you'll probably want to check out Data Macros. I don't have first hand experience with this as we are only using Access 2007 and Data Macros aren't available. If you are using Access 2007 or earlier, you'll probably want to checkout the AfterUpdate event on your SubForm.

Either way, more clarification will greatly help us help you.
Dec 4 '15 #4
Thank you guys but i made the code below and it success

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command373_Click()
  2.  
  3. Dim rs As DAO.Recordset
  4.  
  5. Set rs = Me.InventoryTransactionsSubform.Form.Recordset
  6. With rs
  7.     .MoveFirst
  8.     Do While Not .EOF
  9.         .Edit
  10.         ![Created Date] = Me.CreationDate.Value
  11.         .Update
  12.         .MoveNext
  13.      Loop
  14.  End With
  15.  Set rs = Nothing
  16.  
  17. End Sub
Using Access 2013
Dec 4 '15 #5
zmbd
5,501 Expert Mod 4TB
I am happy that you have a solution.
Please understand, we have an obligation to point you in the right direction first, then if you insist, guide you down the road better not traveled.

You really need to normalize your database, you may very well find in the near future things become less easy to handle.

IN your case, already case in point:
You are changing "N" records in the child table to the creation date, taking up time and storage space, instead of only one record in the parent table.

Save yourself some future pain now by normalizing your data.

-z
Dec 5 '15 #6

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

Similar topics

2
by: Claude | last post by:
Let' say we have an application for a production facility running 24/7 broken into 3 shifts 6-2,2-10,10-6 each production report date contains 3 shifts as above in each shift there can be from...
6
by: Wendy Powley | last post by:
I have a subform which represents a 1:N relationship with the main form. I would like to be able to read values from an external file, fill the subform with the values read & allow the user to...
2
by: Tom van Stiphout | last post by:
Hi All, This one has me stumped. I hope someone else has seen this behavior and knows what's going on. I'm using Access 2003 ADP on Windows XP, database in 2002/2003 format, with SQL Server 2000....
1
by: gavo | last post by:
Hello everyone! Using A2K i have a form(a) with a subform(b) and within the subform there is a continuous subform(c). in the subform (b) there is a command button used to call a public...
3
by: dataeagle | last post by:
In the 'On open' event of a main form, I need to check the values of a nested subform (i.e. subform of a subform). I am able to pass the first value, and even though it goes through each time, it...
2
by: cymichaelip | last post by:
Hi, I am new in MS Access. I am using MS Access 2002. I have a main form which has 10 label (from label1 to lable10), main form also has a subform which has 10 records. Subform has 2 column (one is...
1
by: Kev | last post by:
Hello I have a form (RosterForm) based on a table - RosterRange RosterRange has 4 fields: RosterRangeID Autonumber RosterStartDate Date RosterEndDate Date (probably...
2
by: Gavin Sequeira | last post by:
Hi. I have a Main form with a Subform. My Main form generates an ID and some info is passed to the subform alongwith the ID. Lets say some changes are made to the mainform, this info is then added to...
4
by: 315hughes | last post by:
Good evening all i am trying to loop through a subform records and i need it to display the selected value from each of the records eg: record 1 prod# 2 record 2 prod# 5 record 3 prod# 3 so in...
4
by: jase7678 | last post by:
Hello, I'm confused with my latest issue in Access 2013 because at one point in time it's worked exactly as intended. I'm putting together a pretty large database application so finish one piece...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.