473,657 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing and storing the value in a text box without adding row to table

MS
What's the best way to "store" and display a value in a text box that
changes from day to day. An example of this would be where the name of the
user is manually typed in after using the datbase, along with (say) the
date.

ATM, I have a table with (say) 4 fields. Each field is linked to a column in
a combo box. The combo box is invisible on the form. The text boxes display
previous data using code something like this...

Private Sub Form_Current()

Me.TxtSR = Me.CmbDt.Column (0, 0)
Me.TxtMS = Me.CmbDt.Column (1, 0)
Me.TxtSRCart = Me.CmbDt.Column (2, 0)
Me.TxtMSCart = Me.CmbDt.Column (3, 0)

End Sub

The combo's table is then updated with something like this when new data is
typed in the text box....

Private Sub TxtMS_AfterUpda te()
Dim rstx As Recordset
Dim Dbx As Database

Set Dbx = CurrentDb
Set rstx = Dbx.OpenRecords et("TbleEnt", dbOpenDynaset)
rstx.MoveFirst
With rstx
.Edit
!EntMs = Me.TxtMS
.Update
End With
rstx.Close
Set Dbx = Nothing
End Sub

Each text box has this code.

Is there a better, more direct way to do this? Its the only way I've thought
of "changing" and storing the value of a text box without adding a row to
the table.

This is in A97

Cheers!

Nov 13 '05 #1
3 2117
Do you mean something like a setting? that might change but normally
doesn't

Then you could use ini files or the registry.

Nov 13 '05 #2
MS

"Cable" <cb****@gmail.c om> wrote in message
news:11******** *************@l 41g2000cwc.goog legroups.com...
Do you mean something like a setting? that might change but normally
doesn't

Then you could use ini files or the registry.


No, just the data that the field is storing.

Say a text box that has the name of the user who last accessed the DB. It's
easy to link the text box to a table, but that situation in it's simplest
form adds a row each time the field is changed - i.e. a new record.
Nov 13 '05 #3
MS wrote:
"Cable" <cb****@gmail.c om> wrote in message
news:11******** *************@l 41g2000cwc.goog legroups.com...
Do you mean something like a setting? that might change but normally
doesn't

Then you could use ini files or the registry.


No, just the data that the field is storing.

Say a text box that has the name of the user who last accessed the
DB. It's easy to link the text box to a table, but that situation in
it's simplest form adds a row each time the field is changed - i.e. a
new record.


No it doesn't. At least not unless you are doing something to make that
happen.

By default a bound form will open to the first record in the underlying
table. If you edit a bound TextBox you will be changing the data in that
row, not adding a new row.

Is the DataEntry property of your form set to Yes perhaps. That will cause
it to open to the new record position each time in which case editing the
TextBox would add a new record to the table.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11753
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
7
3635
by: Dave | last post by:
I have a system that basically stores a database within a database (I'm sure lots have you have done this before in some form or another). At the end of the day, I'm storing the actual data generically in a column of type nvarchar(4000), but I want to add support for unlimited text. I want to do this in a smart fashion. Right now I am leaning towards putting 2 nullable Value fields: ValueLong ntext nullable ValueShort nvarchar(4000)...
31
4115
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and populating a simple table. I'd like the table to contain 10 entries per page and have the option for the user to scroll through the pages of data without having to go back to refresh the page (I've already pulled all the info I need from the...
16
2443
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables (se below) then I run a query giving me a running total, which give me the first stock in the batch purchased by an individual, then I use this number and add the number of shares in order to find the number of the individuals' last share. So...
2
2285
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings has 55, then I want Rulings to have a number greater than 55. Two or more Hearings may be entered before a Ruling is entered. For example, Hearings with CaseIDs= 55, 56, and 57 may be entered before a Ruling or vice versa. There is no definite...
1
8566
by: Paul M. Frazier, Ph.D. | last post by:
I am writing a user information update page and I populate the form on Page_Load with the current values of the user's name, etc. When I change the text in one of the textbox controls (e.g., change the user's middle initial from M. to X.) and submit the form, the value seen for middleinitial.text in the Public Sub that is executed when the Update button is clicked is the initial value (M.) and not the new value (X.). Is there something I...
1
2677
by: mplus_2000 | last post by:
I have recently inherited a database. The switchboard (and other forms) displays the name of the database on it (top, center). Currently the name that appears is Reviews. There are plans to roll out the application (i.e. making copies of the database) to other locations (Reviews-NY, Review-Dallas etc). If was mentioned today in passing by the original developer that there is a way to change the title that appears on the switchboard without...
1
2637
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have been easy to resolve but just doesn't seem to work for me ... The original application includes a form page for editing the details of an "item". In my case the item is a comicbook. The page functions just fine as long as I stick with text fields, but I...
4
4092
by: Danny | last post by:
Hi All, I have a varchar(255) column for storing text in english and in hebrew. It was a stupid mistake to set the data type to be varchar, because now I need to store text in german and francais too. Question: Is it safe to change the data type from varchar to nvarchar, without damaging the data that's already present? (I have more than 1000000 records stored...)
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.