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

press button to add record to table while table is in view in form

Status
Not open for further replies.

crnstnsnrd

Technical User
Oct 12, 2001
3
US
I have a table in an access 97 database that I would like to view in a form (actually a tab page of a form) and then have a button below it that will allow a new record to be added to the table while it is in view. For aesthetics sake, I would like to show the table with ONLY the records, and not the "New" empty record at the end of the table, until, of course, the button was pressed.

Is this possible?

Chip Duford
crnstnsn@worldnet.att.net
 
1. Your subform shoud have the Allow Additions property set to NO. This will do away with the new record line.

2. In your command button (I assume it is on the Main From) you will put...

Private Sub cmdButon_Click()
Me![MySubform].Form.AllowAdditions = True
End Sub

To turn the Allow Additions property on.

3. Finally in the subform's after update event you should put...

Private Sub Form_AfterUpdate()
Me.AllowAdditions = False
End Sub

To turn it back off.

Good luck.


ljprodev@yahoo.com
ProDev, MS Access Applications B-)
 
OK ... I think theoretically that would work in my case, but I don't think I explained what I wanted to do. So ... here I go again:

in a page (of a multipage, tabbed form) I have a table I would like to view, add to and delete from. For aesthetic purposes, I would like to not view an empty record until I press a command button to reveal a new record in the table. I would also like to highlight a record and delete it using a command button. the table will be in view at all times, hopefully.

Thanks, lonnie for the help, but it didn't work because I don't think I decribed in a detailed-enough fashion what my needs were.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top