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

Limit the number of records to avoid a blank record 1

Status
Not open for further replies.

NeilT123

Technical User
Jan 6, 2005
302
GB
Hi, I have a form, part of which is based on a temporary table which is populated using the following code

Code:
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings False 'switch off warning messages re adding & deleting records
DoCmd.RunSQL ("INSERT INTO tblTEMPIfCropping SELECT * FROM qryfrmIfCropping")
DoCmd.SetWarnings True 'reset warnings
Me.Requery
DoCmd.Maximize
End Sub

The temporary table is emptied when the form is closed.

When I navigate through the form I get to a blank record which I think is because the temporary table allows new records to be added to it. I don't want the user to get a blank record so is there any way to limit the records in the temporary table exactly to the records in the query?

Thank you for any help
 
Doh! I assumed it was the temporary table that was causing the issue but changing the allow additions property of the form to no has sorted it.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top