473,396 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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_AfterUpdate()
Dim rstx As Recordset
Dim Dbx As Database

Set Dbx = CurrentDb
Set rstx = Dbx.OpenRecordset("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 2100
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.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.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.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.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
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...
7
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...
31
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...
16
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...
2
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...
1
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.,...
1
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...
1
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.