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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access New Record Button

Status
Not open for further replies.

iamchemist

Programmer
Mar 2, 2009
73
US
In an Access application I have a subform within a main form. The subform typically shows information from several records, and since I need to enter a date via this subform, I have placed a "New Record Button" into it straight from the standard Creat Form tool set. The problem is that about half of the time, clicking on the New Record Button does nothing. When this happens, a user must click inside the subform and use the mouse scroll wheel to scroll down to a blank space to enter a new record.

Does anyone know how to make sure that the New Record Button works every time?

Thanks,

Ron (Newbie)
 
What is the code behind your New Record button?
Is the button on your main form, and it calls to add a new record to the subform? just making sure I'm clear. Thanks.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Hi GingerR,

Thanks for your reply. The "New Record Button" that I referred to in my post is part of the subform - not part of the main form. I added it from the standard Forms Toolbox that you see in Forms Design View, where adding a New Record Button to a form is one of the options.

So, essentially I have not written any special code to make the New Record Button function.

Thanks,

Ron
 
so i assume your subform is continuous, with the button in the FORM HEADER. It will make a new record, but won't put the cursor into a field. So add a line of code, something at the end of the current code like

Me.FieldName.SetFocus

with FieldName = the name of the first field that a person will type into. Try that and let us know how it goes.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Hi GingerR,

I am sorry to have ignored this Access question for so long, but I was distracted by a death in family and a few other things.

Thank you very much for your reply. I will try your suggestion and let you know how it works.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top