OpenForm and MoveLast

E

Ed Bloom

How do I get the following pseudo code working?

OpenForm.Maximize - this actully works, I know
Me.MoveLast + 1 - Move to last record of the source table plus start
the Add New Record function
 
B

Brian Bastl

It's not clear; do you want to go to the last entry or a new entry?
Using the form's On Load event procedure:

'go to last record
DoCmd.GoToRecord , , acLast

'go to new record
DoCmd.GoToRecord , , acNewRec

HTH,
Brian
 
S

Sandra Daigle

You don't need to move to the last record - just move to a new record:

docmd.GoToRecord ,,acNewRec
 
E

Ed Bloom

Thank you.

Sandra Daigle said:
You don't need to move to the last record - just move to a new record:

docmd.GoToRecord ,,acNewRec

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Ed said:
How do I get the following pseudo code working?

OpenForm.Maximize - this actully works, I know
Me.MoveLast + 1 - Move to last record of the source table plus
start the Add New Record function
 
E

Ed Bloom

Thank you. I really only needed to go to New Entry. i was using psuedo code
from the forms' record buttons on the bottom.

Thanks again.
 
S

Skot

further to this question, I'm trying to add a new record inside a subform,
when I use the below command on a onClick, it adds a new record to the main
table, not the subform.

Basically, i'm looking to create a button that will automatically fill in
the details for a new record.

Sandra Daigle said:
You don't need to move to the last record - just move to a new record:

docmd.GoToRecord ,,acNewRec

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Ed said:
How do I get the following pseudo code working?

OpenForm.Maximize - this actully works, I know
Me.MoveLast + 1 - Move to last record of the source table plus
start the Add New Record function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top