Go to the last-new row in a datasheet view

  • Thread starter Thread starter Claudio Bogado Pompa
  • Start date Start date
C

Claudio Bogado Pompa

What is the code to go to the last row where is added a new record
when you type something?
I tryed adding a record to the form recordset but I don't want to
leave that record empty, I just want it to be ready to load data into.
Greetings from Paraguay.
Claudio Bogado Pompa.
 
Use the GotoRecord method. It is explained in VBA Help. If you are using a
macro, then it is the GotoRecord action, also in VBA Help.
 
Use the GotoRecord method. It is explained in VBA Help. If you are using a
macro, then it is the GotoRecord action, also in VBA Help.
--
Dave Hargis, Microsoft Access MVP





- Mostrar texto de la cita -

Thank you very much!
Greetings from Paraguay.
Claudio Bogado Pompa.
 
Use the GotoRecord method. It is explained in VBA Help. If you are using a
macro, then it is the GotoRecord action, also in VBA Help.
--
Dave Hargis, Microsoft Access MVP





- Mostrar texto de la cita -

GoToRecord works fine when I am working on a form, but when I try to
use a subform I get the "Form is not opened" error.
How do I solve it?
Greetings from Paraguay.
Claudio Bogado Pompa.
 
Please post the code that is not working. Subforms have to be referenced
differently as they are not open on their own.
 
Please post the code that is not working. Subforms have to be referenced
differently as they are not open on their own.
--
Dave Hargis, Microsoft Access MVP






- Mostrar texto de la cita -

The code is part of the subform.

DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec
 
A sub form is not opened on it's own, so that is not going to work for you.
What event of the subform is the code in?

You might try this in the Load event of the main form:

DoCmd.GoToRecord acDataForm, "[" & Me.SubformName.Form.Name & "]", acNewRec

--
Dave Hargis, Microsoft Access MVP


Claudio Bogado Pompa said:
Please post the code that is not working. Subforms have to be referenced
differently as they are not open on their own.
--
Dave Hargis, Microsoft Access MVP








- Mostrar texto de la cita -

The code is part of the subform.

DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec
 
A sub form is not opened on it's own, so that is not going to work for you.
What event of the subform is the code in?

You might try this in the Load event of the main form:

DoCmd.GoToRecord acDataForm, "[" & Me.SubformName.Form.Name & "]", acNewRec

--
Dave Hargis, Microsoft Access MVP



The code is part of the subform.
DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec- Ocultar texto de la cita -

- Mostrar texto de la cita -

Still getting the "Form not opened" error.
 
I think it is a syntax problem:
DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec

Try
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec

--
Dave Hargis, Microsoft Access MVP


Claudio Bogado Pompa said:
A sub form is not opened on it's own, so that is not going to work for you.
What event of the subform is the code in?

You might try this in the Load event of the main form:

DoCmd.GoToRecord acDataForm, "[" & Me.SubformName.Form.Name & "]", acNewRec

--
Dave Hargis, Microsoft Access MVP



Claudio Bogado Pompa said:
Please post the code that is not working. Subforms have to be referenced
differently as they are not open on their own.
:
Use the GotoRecord method. It is explained in VBA Help. If you are using a
macro, then it is the GotoRecord action, also in VBA Help.
:
What is the code to go to the last row where is added a new record
when you type something?
I tryed adding a record to the form recordset but I don't want to
leave that record empty, I just want it to be ready to load data into.
Greetings from Paraguay.
Claudio Bogado Pompa.- Ocultar texto de la cita -
- Mostrar texto de la cita -
GoToRecord works fine when I am working on a form, but when I try to
use a subform I get the "Form is not opened" error.
How do I solve it?
Greetings from Paraguay.
Claudio Bogado Pompa.- Ocultar texto de la cita -
- Mostrar texto de la cita -
The code is part of the subform.
DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec- Ocultar texto de la cita -

- Mostrar texto de la cita -

Still getting the "Form not opened" error.
 
I think it is a syntax problem:
DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec

Try
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec

--
Dave Hargis, Microsoft Access MVP

Claudio Bogado Pompa said:
A sub form is not opened on it's own, so that is not going to work for you.
What event of the subform is the code in?
You might try this in the Load event of the main form:
DoCmd.GoToRecord acDataForm, "[" & Me.SubformName.Form.Name & "]", acNewRec
--
Dave Hargis, Microsoft Access MVP
:
Please post the code that is not working. Subforms have to be referenced
differently as they are not open on their own.
--
Dave Hargis, Microsoft Access MVP
:
Use the GotoRecord method. It is explained in VBA Help. If you are using a
macro, then it is the GotoRecord action, also in VBA Help.
--
Dave Hargis, Microsoft Access MVP
:
What is the code to go to the last row where is added a new record
when you type something?
I tryed adding a record to the form recordset but I don't want to
leave that record empty, I just want it to be ready to load data into.
Greetings from Paraguay.
Claudio Bogado Pompa.- Ocultar texto de la cita -
- Mostrar texto de la cita -
GoToRecord works fine when I am working on a form, but when I try to
use a subform I get the "Form is not opened" error.
How do I solve it?
Greetings from Paraguay.
Claudio Bogado Pompa.- Ocultar texto de la cita -
- Mostrar texto de la cita -
The code is part of the subform.
DoCmd.GoToRecord acDataForm, "[" & Me.Name & "]", acNewRec- Ocultar texto de la cita -
- Mostrar texto de la cita -
Still getting the "Form not opened" error.

Thank you very much.
In both ways is not working.
I will try tomorrow with a form with a name without spaces.
Greetings from Paraguay.
Claudio Bogado Pompa.
 
Back
Top