Text Box

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

I have a text box which displays the month/year (i.e. Jul/05). What I
would like to do is to keep that month/year constant until I enter a new
month/year. I know that I saw an example of this once before in this
group. I'm hoping that someone will help me. TIA


Larry


Posted Via Binaries.Net Premium Usenet Newsgroup Services
 
Hi, Larry.

Set the field's default value in the textbox' AfterUpdate event:

Me!MyTextbox.DefaultValue = "'" & Me!MyTextbox & "'"

This will work for the current session but will not carry over to the next
time you open the form. If you'd like to do this as well, you can pick up
the value from the last record entered, reset the DefaultValue, and
optionally move to a new record:

DoCmd.GoToRecord acActiveDataObject, "YourForm", acLast
Me!YourTextbox.DefaultValue = "'" & Me!YourTextbox & "'"
DoCmd.GoToRecord acActiveDataObject, "YourForm", acNewRec

Hope that helps.
Sprinks
 
In the TextBox's AfterUpdate event put code like:-

Me!txtBox.DefaultValue = """" & Me!txtBox & """"

where txtBox is your TextBox's name.

hth

Chris
 

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