Solved How do i append records to sub-form (1 Viewer)

atiqahmed

New member
Local time
Today, 21:37
Joined
Mar 17, 2021
Messages
22
Picture1.png

I want to take records from takeProcess table and insert into ProcessDetails sub-form by clicking insert defaults Process with each new record....

Please help me.... database file is attached for your referance...
 

Attachments

  • Database5.zip
    30 KB · Views: 106

theDBguy

I’m here to help
Staff member
Local time
Today, 09:37
Joined
Oct 29, 2018
Messages
21,474
Hi. May just be a mis term, but you don't insert records into a subform. Instead, you insert them into the table bound to the subform.

Sent from phone...
 
Last edited:

atiqahmed

New member
Local time
Today, 21:37
Joined
Mar 17, 2021
Messages
22
Hi. May just be a mis term, but you don't insert records into a subform. Instead, you insert them into the table bound to the subform.
Can you please share my database as example...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:37
Joined
Feb 19, 2002
Messages
43,275
I made a lot of changes.
Your relationships were defined incorrectly so I fixed them. I also fixed the PK names and table names. I cleaned up the tables and removed the unnecessary fields and set the required fields to be required. I removed the indexes on the FK fields since Access will build them automatically. Since I was running an action query in code, I included a macro to turn the warnings off and the hourglass on and a second to turn warnings on and the hourglass off. The hourglass is an annoying graphic feature. If the hourglass is on when you think it shouldn't be then run the "on" macro to turn warnings back on. I do this because it is CRITICAL that you don't leave warnings off accidentally and it is easy to do when you just turn it off without setting the hourglass on.

The code and queries I built are simple. You should be able to understand them but ask if you don't.

I made some assumptions.
1. there would be only the processes from the Process table and none could be added or deleted.
2. I calculated Late_Days in the query rather than storing it. I just did a date-date calculation. If it needs to exclude holidays and weekends, I can give you the functions you need.
3. Status should be a combo so I made one with just two choices. Make these whatever you want.
 

Attachments

  • Database5Pat.zip
    49.2 KB · Views: 109

atiqahmed

New member
Local time
Today, 21:37
Joined
Mar 17, 2021
Messages
22
I made a lot of changes.
Your relationships were defined incorrectly so I fixed them. I also fixed the PK names and table names. I cleaned up the tables and removed the unnecessary fields and set the required fields to be required. I removed the indexes on the FK fields since Access will build them automatically. Since I was running an action query in code, I included a macro to turn the warnings off and the hourglass on and a second to turn warnings on and the hourglass off. The hourglass is an annoying graphic feature. If the hourglass is on when you think it shouldn't be then run the "on" macro to turn warnings back on. I do this because it is CRITICAL that you don't leave warnings off accidentally and it is easy to do when you just turn it off without setting the hourglass on.

The code and queries I built are simple. You should be able to understand them but ask if you don't.

I made some assumptions.
1. there would be only the processes from the Process table and none could be added or deleted.
2. I calculated Late_Days in the query rather than storing it. I just did a date-date calculation. If it needs to exclude holidays and weekends, I can give you the functions you need.
3. Status should be a combo so I made one with just two choices. Make these whatever you want.
Thankyou so much its working correctly...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:37
Joined
Feb 19, 2002
Messages
43,275
Glad it worked for you. The techniques are straight forward but it is important that you understand what I did so you can change the code and property settings if my assumptions were incorrect.
 

Users who are viewing this thread

Top Bottom