Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

Keeping a value in a textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Skip Bisconer - 24 Mar 2008 23:21 GMT
I am updating a table via a form using the table as the data source. I can't
seem to get what I want to work. I have an OrderNo, RouteID and
DeliverySequence field.
The RouteID and DeliverySequence are the fields I need to put data in. They
are blank in the table until they get assigned through the form.
Basic procedure is call up an OrderNo. Assign a RouteID(Text A-Z) and
DeliverySequence (Numeric 1 - many). I have 35 to 40 orders to assign this
information to. I want the RouteID to maintain the value until I change it to
another RouteID. Right now as soon as I update and call the next record the
value is blank for obvious reasons. I am also trying to get the seqence
number to advance by 1 from the previous data update. Any suggestions would
be greatly appreciated.
Graham R Seach - 25 Mar 2008 00:12 GMT
Skip,

The way I do it is to store the values in the Registry.

When you want to store a value, use the following construct:
   SaveSetting "myApplicationName", "Settings", "DefaultWhatever",
Cstr(Me!txtMyTextbox)

Make sure to change "myApplicationName" to the name of your application,
"DefaultWhatever" to the name of the field/control whose value you're
storing, and "txtMyTextbox" to the name of the control containing the actual
value you want to store.

Then when you want to retrieve your value:
   Dim varMyValue As Variant
   varMyValue = GetSetting("myApplicationName", "Settings",
"DefaultWhatever", someDefaultValue)
   Me!txtMyTextbox = varMyValue

Using this construct, you can test varMyValue, and if empty, you can put
Null (or whatever you like) into txtMyTextbox.

Don't forget to also store empty strings when needed.

Check out Help for SaveSetting, GetSetting, and GetAllSettings.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

>I am updating a table via a form using the table as the data source. I
>can't
[quoted text clipped - 13 lines]
> would
> be greatly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.