Defaulting a field to the first entry

  • Thread starter Thread starter J-Skill
  • Start date Start date
J

J-Skill

I am new to access and I am trying to find out if it is possible to set a
field to default to the first answer entered, so that in the next repetition
that field would already be entered. We are using crystal reports linked to
an access database and we have some fields that we don't want to enter over
and over again because they won't change even though the other info will. I'm
using access 2007 but the database is a 2000 file. I realize this may not be
possible but figure it can't hurt to ask. Thanks in advance for any
suggestions or other help.
 
Add the following Event Procedure to the AfterUpdate event of the text box:

Private Sub MyTextbox_AfterUpdate()

Me.MyTextbox.Default = Chr$(34) & Me.MyTextbox & Chr$(34)

End Sub

(replace MyTextbox with the actual name of the text box)

Note that the default value will change every time the value gets changed in
the text box.

Another option, of course, is not to have the field on the form, and simply
run an Update query to populate the field once you're done updating the
table.
 

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