How to bring up blank form

petro62

New Member
Joined
Jul 15, 2013
Messages
46
Office Version
  1. 365
Platform
  1. Windows
Thanks to some amazing help on here I am updated my large asset management excel file. With some great macros that were posted on here I was able to accomplish a lot of what I needed including bring up a form for the user to fill in when they want to add a new asset. The issue I have is the form always start pre-filled with the first item on the list which would allow them to overwrite it. Is there a way to make that form start blank?

I guess all I need to know of the code to put in after the following to so it automatically selects the New button on the form which would bring up a blank form then.

VBA Code:
Sub AddNewTag()
'
' AddNewTag Macro
' Click button to get new tag entry form
'

'
    ActiveSheet.ShowDataForm
End Sub
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi,
quick search & found same question asked here:VBA - ShowDataForm and add new record
#Post 2 should do what you want

Dave
Yes that worked perfectly thanks

VBA Code:
Sub AddNewTag()
'
' AddNewTag Macro
' Click button to get new tag entry form
'

'
    With Sheets("Tag Name")
        .Select
        Application.SendKeys ("%w")
        DoEvents
        Application.SendKeys ("%w")
        .ShowDataForm
    End With
    Sheets("Tag Name").Activate
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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