New entry, insert default text in field

K

KT

Hello,

Another novice question: I have a form for inputting event data into a
table. I would like the field called "Event Type" to be automatically filled
in with the word "Wedding", so that the person filling in the form doesn't
have to bother putting that in each time.

How do I do this, is this a query?

Thank you!
KT
 
M

Matt

In design view on your table, change the field properties' default value to
="Wedding".
 
K

KT

Hi Matt,

The wedding form is only one of the ways to get data into my table, and I
don't want that field to always read "Wedding", just when they use the form...

Thank you!
KT
 
J

Jim Ory

You were not clear on what you do when you "use the wedding form". If you are
adding a record in the "wedding" form, I would assume there is a "date"
field. In the "Date" field's "After Update" event, add the code:

On Error GoTo ProcError

Me.(the name of the control on your form where you want the word Wedding to
go) = "Wedding" 'Note: remove parens.

ExitProc:
Exit Sub
ProcError:
MsgBox "error" & Err.Number & ": " & Err.Description
Resume ExitProc

Each time you enter a date in the wedding form to add a new record, the
field where you want the word Wedding to be will be entered automatically.
You can change it later if you need.
 
Top