Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form with datasheet updating issue 2

Status
Not open for further replies.

aph

Technical User
Jul 8, 2000
134
0
0
GB
Hi I've a form from one table that has within it a datasheet from another when I click on a standard new record button it creates a new record for the main form but the data sheet stays as is showing all the previous data entered on it is ther a way that when you click new record for the main form it also will create a new record on the data shet as well?

E.G clicking the one button adds a new record to both?
cheers for any info that can be given
 
I don't see it. The main form is a parent to the form with the datasheet and because of the relationship the main form serves as a lookup.
 
Ok basically the main form is for recording production data E.G customer, job number, type of material used etc..

The data sheet is because some of the data recoreded needs alot of enteries E.G in this form we record measurments every half hour and so over a 12 hour production run there are going to be a lot of entries so I made a data sheet and draged this into the form so now i have a form with a datasheet in.

The problem is whe I create another new roceod for the next job the data sheet still showing all the dtat entered from the previous entries on the previous job, what I wish to do is when the new record is created for the main form the data sheet is also cleraed and ready for the new data.

hope that explains it a little more.
 
OK, I created a sample using two tables. The main form based on the first table and dragged the second table on to the form thus creating a sub form. I entered data into the main form - say the job field - and was able to add data into the subform. I then started a new record in the main form, the sub cleared and the process started again with no problem. I ended up with a bunch of data in the subform (s) related to several records in the main form. How do you have your tables set up? Maybe run a sample db to test?

hoof
 
aph,
You haven't mention anything about the link master and link child properties of the subform control. You need something in these properties to synch the main and subform.

Duane
Hook'D on Access
MS Access MVP
 
Hi main main link is you have to enter the job number into the main form and the sub form I'll have another go and see what happens.

"OK, I created a sample using two tables. The main form based on the first table and dragged the second table on to the form thus creating a sub form. I entered data into the main form - say the job field - and was able to add data into the subform. I then started a new record in the main form, the sub cleared and the process started again with no problem. I ended up with a bunch of data in the subform (s) related to several records in the main form. How do you have your tables set up?"

This is how I did it very strange? I'll have a look at the link you have posted and hopefully if i get time have another look at it today.
 
When you dragged your subform to the main form - it should have asked you how you wanted to link them up.

Here's how to check:

On your Form - click the subform so that the whole thing is selected (like you were going to adjust its size). Then Right Click and select Properties.

On the Data Tab you will see Link Master Fields and Link Child Fields. These should be populated. If they are not then Access does not know how to link the information so it stays together.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top