Default_Value

  • Thread starter ashraf_al_ani via AccessMonster.com
  • Start date
A

ashraf_al_ani via AccessMonster.com

Dear All

How Can I Change The Default Value For a text value
(when i enter the value in the text ,that text will keep the value as a
default value and when i change this value that text will change the default
value to the new value)

waiting your response

best regards
 
D

Douglas J. Steele

Try the following in the control's AfterUpdate event:

Private Sub MyTextbox_AfterUpdate()

Me!MyTextbox.DefaultValue = Chr(34) & Me!MyTextbox & Chr(34)

End Sub
 
A

ashraf_al_ani via AccessMonster.com

Dear Douglas

thanks for your help

but the code didnt work with me
pls any any example or idea how to solve this problem

best regards
Try the following in the control's AfterUpdate event:

Private Sub MyTextbox_AfterUpdate()

Me!MyTextbox.DefaultValue = Chr(34) & Me!MyTextbox & Chr(34)

End Sub
[quoted text clipped - 7 lines]
best regards
 
D

Douglas J. Steele

Hmm. It works fine for me.

At the risk of insulting you, did you use it correctly?

You need to:

1) Look at the Properties associated with your text box, and find the
AfterUpdate property.
2) Set the AfterUpdate property to [Event Procedure], then click on the
ellipsis (...) to the right of the property.
3) That will take you into the VB Editor, in the middle of code like

Private Sub MyTextbox_AfterUpdate()

End Sub

(NOTE: "MyTextbox" will be replaced by whatever the name of your text box
is)

4) Type the one line of code into that routine, so that you have what I
originally suggested

(NOTE: Make sure you replace "MyTextbox" with the actual name of your text
box in all places)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


ashraf_al_ani via AccessMonster.com said:
Dear Douglas

thanks for your help

but the code didnt work with me
pls any any example or idea how to solve this problem

best regards
Try the following in the control's AfterUpdate event:

Private Sub MyTextbox_AfterUpdate()

Me!MyTextbox.DefaultValue = Chr(34) & Me!MyTextbox & Chr(34)

End Sub
[quoted text clipped - 7 lines]
best regards
 

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

Top