Open database from child form

  • Thread starter Thread starter John F.
  • Start date Start date
J

John F.

Hi,
I have a subform and a button that I want to click to enter a new record on
the subform. I've tried the following but it doesn't do anything. When I
click the 'Add New Record' on the bar at the bottom of the subform, it opens
to a new record; this is the action that I want to replicate on my button.
How do I d this?

This is the code that doesn't work:

Private Sub btnAddNewAdmission_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb()
Set rs = db.OpenRecordset("tblAdmitDateLocation")

rs.AddNew
rs.Bookmark = rs.LastModified


Thanks in adavance!

John Fowler.
 
On Sat, 13 Dec 2008 19:27:01 -0800, John F.

Replace all of that with:
RunCommand acCmdRecordsGoToNew

-Tom.
Microsoft Access MVP
 
Thanks, that works great.

john.

Tom van Stiphout said:
On Sat, 13 Dec 2008 19:27:01 -0800, John F.

Replace all of that with:
RunCommand acCmdRecordsGoToNew

-Tom.
Microsoft Access MVP
 
Back
Top