clear fields on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I'm working on a form in an Access project that uses bound fields. When I
bring the form up, it's got the first entry in the table. I tried making the
values blank on the form load() but it doesn't like that. How and where do I
clear them so they are blank?
thanks
DoCmd.OpenForm strFormName, acNormal, acEdit
 
Hi Maggie

Do you mean that you want to open the form ready to accept a new record?

In that case, change your acEdit to acAdd.
 
hi Graham,
Yes, Graham, that is what I wanted it to do.

It still has values in the fields from the first record in the table. I
found the code that calls up this form and it says : DoCmd.OpenForm "add
new", FormToOpen. The other code I thought was executing was not being
called. I changed the
DoCmd.OpenForm "add new", FormToOpen to docmd.openform "add new", acnormal,
acadd, and it still doesnt work. Does it matter if this is an ADP project?

thanks

Graham Mandeno said:
Hi Maggie

Do you mean that you want to open the form ready to accept a new record?

In that case, change your acEdit to acAdd.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Maggie said:
hi,
I'm working on a form in an Access project that uses bound fields. When I
bring the form up, it's got the first entry in the table. I tried making
the
values blank on the form load() but it doesn't like that. How and where do
I
clear them so they are blank?
thanks
DoCmd.OpenForm strFormName, acNormal, acEdit
 
Try this

Docmd.OpenForm "add new",acNormal,,,acFormAdd

--
Good Luck
BS"D


Maggie said:
hi Graham,
Yes, Graham, that is what I wanted it to do.

It still has values in the fields from the first record in the table. I
found the code that calls up this form and it says : DoCmd.OpenForm "add
new", FormToOpen. The other code I thought was executing was not being
called. I changed the
DoCmd.OpenForm "add new", FormToOpen to docmd.openform "add new", acnormal,
acadd, and it still doesnt work. Does it matter if this is an ADP project?

thanks

Graham Mandeno said:
Hi Maggie

Do you mean that you want to open the form ready to accept a new record?

In that case, change your acEdit to acAdd.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Maggie said:
hi,
I'm working on a form in an Access project that uses bound fields. When I
bring the form up, it's got the first entry in the table. I tried making
the
values blank on the form load() but it doesn't like that. How and where do
I
clear them so they are blank?
thanks
DoCmd.OpenForm strFormName, acNormal, acEdit
 
Thanks Ofer - that worked very well.:)


Ofer Cohen said:
Try this

Docmd.OpenForm "add new",acNormal,,,acFormAdd

--
Good Luck
BS"D


Maggie said:
hi Graham,
Yes, Graham, that is what I wanted it to do.

It still has values in the fields from the first record in the table. I
found the code that calls up this form and it says : DoCmd.OpenForm "add
new", FormToOpen. The other code I thought was executing was not being
called. I changed the
DoCmd.OpenForm "add new", FormToOpen to docmd.openform "add new", acnormal,
acadd, and it still doesnt work. Does it matter if this is an ADP project?

thanks

Graham Mandeno said:
Hi Maggie

Do you mean that you want to open the form ready to accept a new record?

In that case, change your acEdit to acAdd.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

hi,
I'm working on a form in an Access project that uses bound fields. When I
bring the form up, it's got the first entry in the table. I tried making
the
values blank on the form load() but it doesn't like that. How and where do
I
clear them so they are blank?
thanks
DoCmd.OpenForm strFormName, acNormal, acEdit
 
Back
Top