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

Only one new record wanted...

Status
Not open for further replies.

ssecca

Programmer
Feb 13, 2002
219
0
0
US
I have a popup\modal form that is used to create a new record in an application. Basically the user clicks a button it opens a form that allowsadditions. The user puts in the basic information required and clicks save. That closes the input form and returns the user to the view and edit form where they complete any data enty needed.

What I don't want is for the user to be able to tab into a second new record while in the popup. I only want one new record created. I have succesfully stopped the second record via the mouse wheel but can not seem to stop it via other means (tab or arrow). Is ther a way of preventing a form from automatically going to the next new record? Or is there a way to prevent tabing to the next new record. Or should I just rethink this whole thing.
 
How about making the data entry fields unbound, then when a Save button is clicked run an Insert using the field values on the form.
 
Have you tried to turn off the "Navigation Buttons" in the Properties of the Form? It is under the "Format" tab.
 
you'll also want to play with "cycle" in the properties of the form. I think that's what tabs you to the next record.
 
How are ya ssecca . . . . .

In the [blue]AfterUpdate event[/blue] of the PopUp form, try the following ([blue]you![/blue] substitute proper names in [purple]purple[/purple]):
Code:
[blue]   If DMax("[[purple][b]PrimaryKeyName[/b][/purple]]", "[purple][b]TableName[/b][/purple]") = Me![purple][b]PrimaryKeyName[/b][/purple] Then
      Me.AllowAdditions = False
   End If[/blue]

Calvin.gif
See Ya! . . . . . .
 
Three of the suggestions here seem to work well. I thank you all for your help. I chose the "cycle" option as it was the easiest to use when updating about thirty forms.

Again thanks for all the input.

ssecca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top