New entry, insert default text in field

  • Thread starter Thread starter KT
  • Start date Start date
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
 
In design view on your table, change the field properties' default value to
="Wedding".
 
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
 
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.
 

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

Back
Top