Cannot got to next record ?

D

Daisy

Hello all,

I have asked this question before, but sofar didn't get a
satisfying answer :(

My previous question was:
I have put a 'go to next record' button on my data entry
form. However, when I click it (ofcourse after filling in
data), I get the message "You can't go to the specified
record". What's that about ? I am using Access 2003....

Now:
I have programmed the following three options, neither of
them seem to work. The latter two give me that I cannot go
to the specified record, the first one seems to work, but
doesn't. I have no clue what I am doing wrong here. It
must not be that complicated, is it ? Please help.

DoCmd.GoToRecord , , acNext

DoCmd.GoToRecord , , acNewRec

and

DoCmd.GoToRecord , , acNewRec
[Form_History of medical conditions].PERIOD.SetFocus
 
G

Guest

Hello Daisy,
By the message you get, it seems that you can not go to next record because
you are allready in a new record. Until you save your record the forms flag
is true(yourform.NewRecord = true). So when you invoke the Goto ... command
you get the error.
possible Solution:
place the following line before the call to next record
(for access2000 )
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If you have another version find the exact 'acMenuVerXX' from Help

Another possible reason is that somehow in your code you are changing the
form's attribute for not allowing new records (but i really don't think so!)
Hope i helped a litle
 
D

Daisy

Thank you very much, but that gives me back the line at
the bottom I wanted to be gone. It still gives me the
error however..
Any other ideas ?
-----Original Message-----
Hello Daisy,
By the message you get, it seems that you can not go to next record because
you are allready in a new record. Until you save your record the forms flag
is true(yourform.NewRecord = true). So when you invoke the Goto ... command
you get the error.
possible Solution:
place the following line before the call to next record
(for access2000 )
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If you have another version find the exact 'acMenuVerXX' from Help

Another possible reason is that somehow in your code you are changing the
form's attribute for not allowing new records (but i really don't think so!)
Hope i helped a litle

Daisy said:
Hello all,

I have asked this question before, but sofar didn't get a
satisfying answer :(

My previous question was:
I have put a 'go to next record' button on my data entry
form. However, when I click it (ofcourse after filling in
data), I get the message "You can't go to the specified
record". What's that about ? I am using Access 2003....

Now:
I have programmed the following three options, neither of
them seem to work. The latter two give me that I cannot go
to the specified record, the first one seems to work, but
doesn't. I have no clue what I am doing wrong here. It
must not be that complicated, is it ? Please help.

DoCmd.GoToRecord , , acNext

DoCmd.GoToRecord , , acNewRec

and

DoCmd.GoToRecord , , acNewRec
[Form_History of medical conditions].PERIOD.SetFocus
.
 
G

Guest

Have you checked that the form's Allow Additions property on the Data tab
properties is set to 'Yes'.

Pete



Daisy said:
Thank you very much, but that gives me back the line at
the bottom I wanted to be gone. It still gives me the
error however..
Any other ideas ?
-----Original Message-----
Hello Daisy,
By the message you get, it seems that you can not go to next record because
you are allready in a new record. Until you save your record the forms flag
is true(yourform.NewRecord = true). So when you invoke the Goto ... command
you get the error.
possible Solution:
place the following line before the call to next record
(for access2000 )
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If you have another version find the exact 'acMenuVerXX' from Help

Another possible reason is that somehow in your code you are changing the
form's attribute for not allowing new records (but i really don't think so!)
Hope i helped a litle

Daisy said:
Hello all,

I have asked this question before, but sofar didn't get a
satisfying answer :(

My previous question was:
I have put a 'go to next record' button on my data entry
form. However, when I click it (ofcourse after filling in
data), I get the message "You can't go to the specified
record". What's that about ? I am using Access 2003....

Now:
I have programmed the following three options, neither of
them seem to work. The latter two give me that I cannot go
to the specified record, the first one seems to work, but
doesn't. I have no clue what I am doing wrong here. It
must not be that complicated, is it ? Please help.

DoCmd.GoToRecord , , acNext

DoCmd.GoToRecord , , acNewRec

and

DoCmd.GoToRecord , , acNewRec
[Form_History of medical conditions].PERIOD.SetFocus
.
 
D

Daisy

Hi Pete,

Yes, all 'Allow' properties are set to Yes. So that cannot
be the problem. I have even found a new one: I can now go
to a new/next (what's the difference anyway ?) record, but
only once. I get the error message after that. And the
entry into this second record overwrites the first
one.... ?!?!?!?!?
-----Original Message-----
Have you checked that the form's Allow Additions property on the Data tab
properties is set to 'Yes'.

Pete



Daisy said:
Thank you very much, but that gives me back the line at
the bottom I wanted to be gone. It still gives me the
error however..
Any other ideas ?
-----Original Message-----
Hello Daisy,
By the message you get, it seems that you can not go
to
next record because
you are allready in a new record. Until you save your record the forms flag
is true(yourform.NewRecord = true). So when you invoke the Goto ... command
you get the error.
possible Solution:
place the following line before the call to next record
(for access2000 )
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If you have another version find the
exact 'acMenuVerXX'
from Help
Another possible reason is that somehow in your code
you
are changing the
form's attribute for not allowing new records (but i really don't think so!)
Hope i helped a litle

:

Hello all,

I have asked this question before, but sofar didn't
get
a
satisfying answer :(

My previous question was:
I have put a 'go to next record' button on my data entry
form. However, when I click it (ofcourse after
filling
in
data), I get the message "You can't go to the specified
record". What's that about ? I am using Access 2003....

Now:
I have programmed the following three options,
neither
of
them seem to work. The latter two give me that I
cannot
go
to the specified record, the first one seems to
work,
but
doesn't. I have no clue what I am doing wrong here. It
must not be that complicated, is it ? Please help.

DoCmd.GoToRecord , , acNext

DoCmd.GoToRecord , , acNewRec

and

DoCmd.GoToRecord , , acNewRec
[Form_History of medical conditions].PERIOD.SetFocus


.
.
 
D

Dale Fye

Daisy,

When I add navigation buttons to my forms, I include a
Buttons subroutine which gets call by the forms Current
event.

In the Buttons subroutine, I enable, disable controls
based on where I am in the recordset and whether I am on a
new record or not. The following is just a snippet of
what the code might look like. I usually add checks to
disable the first and previous buttons if currently on
the "first record", and the next and last buttons if
currently on the "last record".

By doing this, you will be forced to save or cancel the
current record before being able to move to the next or
add a new record

Hope this helps (HTH)
Dale

Something like:

Public Sub Buttons

'set the focus on the first text field
me.sometextfield.setfocus

If me.newrecord then
me.cmd_Next.enabled = false
me.cmd_Previous.enabled = false
me.cmd_AddNew.enabled = false
me.cmd_Cancel.enabled = true
me.cmd_Save.enabled = true
else
me.cmd_Next.enabled = TRUE
me.cmd_Previous.enabled = true
me.cmd_Cancel.enabled = false
me.cmd_Save.enabled = false
endif

end sub
-----Original Message-----
Hi Pete,

Yes, all 'Allow' properties are set to Yes. So that cannot
be the problem. I have even found a new one: I can now go
to a new/next (what's the difference anyway ?) record, but
only once. I get the error message after that. And the
entry into this second record overwrites the first
one.... ?!?!?!?!?
-----Original Message-----
Have you checked that the form's Allow Additions
property
on the Data tab
properties is set to 'Yes'.

Pete



Daisy said:
Thank you very much, but that gives me back the line at
the bottom I wanted to be gone. It still gives me the
error however..
Any other ideas ?

-----Original Message-----
Hello Daisy,
By the message you get, it seems that you can not go to
next record because
you are allready in a new record. Until you save your
record the forms flag
is true(yourform.NewRecord = true). So when you invoke
the Goto ... command
you get the error.
possible Solution:
place the following line before the call to next record
(for access2000 )
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
If you have another version find the exact 'acMenuVerXX'
from Help

Another possible reason is that somehow in your code you
are changing the
form's attribute for not allowing new records (but i
really don't think so!)
Hope i helped a litle

:

Hello all,

I have asked this question before, but sofar didn't get
a
satisfying answer :(

My previous question was:
I have put a 'go to next record' button on my data
entry
form. However, when I click it (ofcourse after filling
in
data), I get the message "You can't go to the specified
record". What's that about ? I am using Access 2003....

Now:
I have programmed the following three options, neither
of
them seem to work. The latter two give me that I cannot
go
to the specified record, the first one seems to work,
but
doesn't. I have no clue what I am doing wrong here. It
must not be that complicated, is it ? Please help.

DoCmd.GoToRecord , , acNext

DoCmd.GoToRecord , , acNewRec

and

DoCmd.GoToRecord , , acNewRec
[Form_History of medical conditions].PERIOD.SetFocus


.
.
.
 

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