A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text box on forms



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2006, 07:24 PM posted to microsoft.public.access
external usenet poster
 
Posts: n/a
Default Text box on forms

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

  #2  
Old February 22nd, 2006, 07:30 PM posted to microsoft.public.access
external usenet poster
 
Posts: n/a
Default Text box on forms

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/...UBED1=ACCESS-L


wrote in message
ups.com...
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Looking for Help Little Penny Using Forms 6 December 27th, 2005 08:33 PM
Newbie table Layout (Posted as suggested by Tom Lake for feedback) Little Penny Using Forms 2 December 25th, 2005 04:44 PM
Add New Field to DB Karen Database Design 7 October 19th, 2005 08:03 PM
Query for 'confirmation' rogge Running & Setting Up Queries 8 April 19th, 2005 03:26 PM
Access reports with a horizontal line after each record??? Bill via AccessMonster.com Setting Up & Running Reports 6 March 9th, 2005 04:51 PM


All times are GMT +1. The time now is 09:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.