Form Data Not Saving to Correct Record in Table

G

Guest

I added two fields (FuelPuchased and FuelPrice) to an existing table
(Expenses). The database was previously built and working properly. The
Primary Key for Expenses is ExpenseID.

On the form (frmExpenses) that was already built, I added a command button
to open a new form (frmFuelExpenses) where the user adds fuel purchased data.
After entering the data, I use the After_Update property to manipulate the
data to send some of it to the frmExpenses in a certain format. But, I also
keep the Fuel data that was added to the frmFuelExpenses to get stored with
the Expenses table in the newly added fields.

What is happening is the fuel expense data is getting saved to the first
record in the Expenses table. I tried setting the control source for the
ExpenseID on the frmFuelExpenses = Forms!frmExpenses.ExpenseID and it does
indeed show the correct ExpenseID when the frmFuelExpenses open, but the data
still gets saved to the first record in the Expenses table.

Any help to get the data saved to the correct record would be appreciated.
 
J

JohnFol

There is no concept of "first records" in a table.

Are you saying that for a given Expense there could be more that 1 related
fuel expense?
When you save some of the fuel expense data back to frmExpense, how do you
do it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top