Re: Add New Record



Okay, Herman, let's clarify what's going on here. Can you verify all of these?

1. The form is based on a query.
You can enter a new record if you open the query directly.

2. You double-cheked the form properties suggested.

3. You are able to edit existing records okay in this form.

4. When you click the command button with the 2 lines of code suggested, it goes to a new record. But you are unable to type any value into any control on the form once you go to the new record.

Questions:
a) Is there any code in this form's module? If so, copy the code out to Notepad, and save it as text. Then set the form's HasModule to No, answering Yes to the warning. Compact the database. Did that make any difference? (Later, you can copy the code from Notepad, and paste it back into the form's module.)

b) Is the form a subform? Are you able to enter a new record if you open it directly (i.e. not as a subform)?

c) Is there a text box on the converted form that Access wrongly converted into a label? Under some conditions, the converter can fail and you end up with a Label control bound to a field, which doesn't work at all of course.

Beyond that, we may be looking at a corrupted form. Does this problem occur with only one form?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Herman" <Herman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:32F397BF-2D94-465E-B522-9765AA2915BA@xxxxxxxxxxxxxxxx
The form is based on a query (select statement in Record Source).
If I open the data*** view, I can enter a new record.
In Office 97 it worked fine.

"Allen Browne" wrote:

Is the form based on a table or query?
If query, open it directly.
Are you able to enter data there?
If not, you won't be able to do so in the form either.

If that's not the issue, open the form in design view.
Open the Properties box, ensuring its title says Form (so you are looking at
the properties of the form, not those of a text box.)
On the Data tab, make sure you have:
Recordset Type Dynaset
Allow Additions Yes

"Herman" <Herman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D4D124DF-358C-45EE-BF3B-B0CE87F0B326@xxxxxxxxxxxxxxxx
> Thanks for your reaction.
> However, I need some additional help.
>
> If I click on the button, it looks if a new record has been created, > but I
> cannot enter data.
>
> "Allen Browne" wrote:
>
>> Here's a little safer version:
>>
>> If Me.Dirty Then Me.Dirty = False
>> If Not Me.NewRecord Then RunCommand acCmdRecordsGotoNew
>>
>> "Herman" <Herman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:F5A1BFEB-01BB-44FE-842A-EBBDA4781156@xxxxxxxxxxxxxxxx
>> >I converted a database from Access 97 to Access 2003.
>> > The button to create a new record doesn't work anymore.
>> >
>> > I use the following code:
>> >
>> > DoCmd.GoToRecord , , acNewRec
>> >
>> > Is additional code required?

.