You can't go to the specified record (acNewrec)

J

Joy M

Hi -

I open an Invoice form and InvoiceDetails subform as a New Rec in the
current event for the parent.
I put data in both forms and save them. I can see the data in both tables
OK.

What I would like is for the InvoiceDetails subform to prompt me with the *
(asterisk) row.
In the begining, there is just the triangle, then it changes to the pencil
(record is dirty), then back to the triangle when
the record is saved.

After the record is saved, I would like to have the option to go to
the following row automatically, in case there is another Premium for that
Invoice.

I have tried
DoCmd.GoToRecord , , acNewRec

It gives the message. "You can't go to the specified record"

I don't see why I am getting this message.
I don't know how to get the * (asterisk) row prompt.
I don't know what else to do.
Any thoughts?

Thanks for your help. I appreciate it.

Joy
 
T

tina

is your subform bound to a table, or to a query? if it's a query, please
post the SQL statement.

hth
 
J

Joy M

Hi Tina,

Thanks for your help.

The subform record source is tblInvoiceDetails (a table).

I had Cycle set to Current Record on the main form; I changed it back to All
Records. Don't know if it has any effect on ability to add new records.

The behaviour I get is one row in the datasheet on the subform. If you are
in the last field, and tab off it, you don't get a new row.
Actually, as soon as you dirty the first row (add new), you should get a
prompt for the row with the asterisk. I can't seem to get that row
underneath.
I just want to see that row with the asterisk (*) so the user has the option
to enter more data in the subform.

My attempts for the Add New Record Routine in the subform.
DoCmd.GoToRecord , , acNewRec
Gives the message: You can't go to the specified record

DoCmd.GoToRecord acDataForm, "subfInvoiceCompany", acNewRec
Gives the message: The object 'sublInvoiceDetails' isn't open.

Forms!frmInvoice!subfInvoiceCompany.Form.Recordset.AddNew
Doesn't go to the error routine, but I still can't bring up that second row
with the * (asterisk).

Thanks again,

Joy
 
T

tina

Actually, as soon as you dirty the first row (add new), you should get a
prompt for the row with the asterisk. I can't seem to get that row
underneath.

well, you're absolutely right. and i'm stumped as to why the system would
allow you to enter one new record, but then no more. is there any code
running behind the subform? if so, is there code that changes the
AllowAdditions property from Yes to No, or the RecordsetType from Dynaset to
Snapshot? or any other code you think might have a bearing on the issue?
 

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