cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlanR
Helper III
Helper III

Data overwriting the first record instead of appending

Hi,

 

I have a very simple app with an Excel workbook as the data source.  When I generate a new record via the app it overwrites the first record in the Excel workbook rather than appending it to the bottom of the table, does anyone know why this would be and how I can fix it?

 

Many thanks,

Alan

2 ACCEPTED SOLUTIONS

Accepted Solutions

@AlanR 
Ok, got it, thanks!  To write to a newline your form must be changed to 'New' mode.  Put this code in the OnSelect property of a button.  Then submit the form to see the result.

 

NewForm(EditForm1)

 

Additionally, you could also change the DefaultMode of EditForm1 to this code

FormMode.New

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Many thanks @Jeff_Thorpe that worked too!  Nice to have multiple solutions, (from yourself and @mdevaney ).

 

If you have a chance to see my second question in the previous post about the best method for selecting multiple items and saving it to one record instance I would appreciate any advice you may have.

 

View solution in original post

15 REPLIES 15
mdevaney
Super User
Super User

@AlanR 
Please provide all information needed to replicate your issue.  Its pretty hard to know why something is happening if you don't give any code or screenshots.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @mdevaney , thanks for taking the time to look at this and reply.  I have attached an Excel file with some screen captures that hopefully explain the problem.  Please let me know if you have any ideas!

 

Alan

@AlanR 

Sorry, but I don't want to download an Excel file onto my PC.  Please explain it in a message instead.  Take screenshots if necessary.

Hi @mdevaney , no problem, can't be too safe.  Hopefully the attached screen shot works.

 

 

 

@AlanR 
Ok, got it, thanks!  To write to a newline your form must be changed to 'New' mode.  Put this code in the OnSelect property of a button.  Then submit the form to see the result.

 

NewForm(EditForm1)

 

Additionally, you could also change the DefaultMode of EditForm1 to this code

FormMode.New

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaneymany thanks!  I wont get a chance to implement your suggestions until Monday but will but will relay when I do, just wanted to say thanks for the quick help!

 

Alan

@AlanR 
Ok, awesome.  I am 100% sure the code will work if you put it in the right place.

 

 

The community support team (paid Microsoft employees) tend to add additional comments to a thread if its left for a few days. Just ignore them and we'll continue working on the issue together, lol.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

Absolutely @mdevaney , I am all for community support 😊

Hi @mdevaney , thanks again for the help.  I tried both of your suggestions today.  The first one, with the additional button, works great.  The second solution, (changing the defaultmode on Editform1 to FormMode.New), worked when I first changed it but when I added a second record it overwrote the first record in the worksheet again.  Looking at the defaultmode of editform1 its value is "New" but when I click on the formula bar it shows as "FormMode.New" - is this normal?  

 

I would also really value your opinion on a new issue.  I have a list of items, (screen shot attached), I want to allow the user to select multiple, non-current items from this list and save them to a single record instance.  I was thinking a drop down would be the best way to display the list but can you select multiple non-concurrent items in a drop down?  If not could you suggest an alternative?  Checkboxes might work but then the form would be so long it would be almost unworkable.

 

Many thanks,

Alan

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,244)