Continious form - hide the new row - add new row with button?

behedwin

Active Member
Joined
Dec 10, 2014
Messages
399
Hey

I have a continuous form.
I want to add one button in the form header that say, "create new record".

Is this possible?

I only want to see the data that is already in the table that is connected to the form.
I do not want to see an empty row of data where i could enter data if i wanted to add a new record.
But if i press the button create new record, then i want to see the fields so the user can enter a new record.

How am i doing this?


I have tried this:

Code:
DoCmd.GoToRecord , , acNewRec

This works in a way but only if i set the option allowadditions to true.
But if i do that i always have an empty row of my fields at the end of the continious form.
So can i hide that row somehow?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hah
i think i solved it.

I have this code in a button in my form header of my continuous form.

Code:
Private Sub Command77_Click()

Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec


End Sub


Then on each textbox/control in my continuous form i have set this code to every "on change" event.

Code:
Private Sub Text65_Change()
Me.AllowAdditions = False
End Sub


So when i press the button, allowaddition is set to true. Focus is moved to the field of typing in the new data.
As soon as the user types something, the change event is triggerd and sets allow additions to false and hides the new record row.
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top