I need help with new record

G

Guest

I have a form that has 3 fields. The form <data entry> property is set to
yes. I have an add new record button on the form to add new record. however,
when I click it I get a message:"Can not go to this record". I tried to make
a save button so that the user would click on it first to save and refresh
then add new record but I am getting a message saying that "Action
cancelled". I have another form designed the same way for another table with
the following line of code in the onexit event in the last txtbox:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70

when I click add new record button it works fine but the other form does
not. any Idea
thanks
Al
 
G

Guest

Go to the row source of the form, open that table or query and try to add a
record there.
it could be that the form is base on a query that doesnt let you add new
records
 
G

Guest

yes I can enter from the query but not from the form. I need to enter one
record then close then open again to enter another. the add new record button
does not work. it says " can not go to specified record"?
any other ideas
thanks
Al
 
G

Guest

Try and change the DataEntry to false, press the button and see what happen.
If you dont have any luck, can you send the code under the button to go to
new record.
 
G

Guest

It is just a standred button made by the wizard
Private Sub cmdNew_Click()
On Error GoTo Err_cmdNew_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdNew_Click:
Exit Sub

Err_cmdNew_Click:
MsgBox Err.Description
Resume Exit_cmdNew_Click

End Sub
Still does not work even after setting the dataentry property to false.
any Idea
thanks
Al
 

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