Text box on forms

P

pleclerc

I have a very simple form with a text box and a command button. When I
open the form for the first time the text box is empty. I enter "Peter"
I click on the command button and the form closes. When I open it again
the text box should read "Peter". I can then enter "Mike" and click on
the command button. The next time I open the form I want it to read"
Mike".

I want the text box to show me the last value entered by the user.

I have tried

Private Sub Commande2_Click()

varpath = txbPath
txbPath.DefaultValue = varpath
DoCmd.Close acForm, "frmStart", csaveyes

Call proBysection
End Sub

and it doesn't work
 
R

Roger Carlson

The easiest way is to have the form bound to a small table with just one
record and one field. Have the textbox bound to your field. Make sure you
disable the navigation buttons on the form. When you enter a value, it will
get saved in the table ready for the next time.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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