473,386 Members | 1,943 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,386 software developers and data experts.

how to save the textbox content to table field?

how to save the textbox content to table field?
For example: i have a form name form1, in this form it has a textboxes name Doc No, Number & Date
In Table, my table name is table1, and field names; Doc No & Date
If the textbox Doc No has a controlsource of =Date() & "-" & Format([ID],"000")
the output of textbox Doc No is 080510-001
how can i save this doc no to my table1?

thnx,

ayarowji
Aug 5 '10 #1
1 4494
Steven Kogan
107 Expert 100+
The textbox Doc No contains a calculation, instead of being bound to the Doc No field. That could get confusing.

First I'd rename the textbox Doc No to Doc No Calculated.

Now you need to decide what event will cause Doc No Calculated to be entered into the Doc No field.

VBA code to put Doc No Calculated into the Doc No field would be:

Expand|Select|Wrap|Line Numbers
  1. me.[Doc No] = me.[Doc No Calculated]
The end solution will probably be more complicated...

Perhaps you want Doc No to be filled in only if it is currently blank, in which case the code would be:
Expand|Select|Wrap|Line Numbers
  1. If nz([Doc No],"")="" Then
    me.[Doc No] = me.[Doc No Calculated]
    End If
That code might go in the form's before update event, depending on your situation.
Aug 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Newbee Adam | last post by:
how to save textbox values to 2 tables using sqladapter I am new with this. Do I need to ADO.net? what is the simplist correct way? or can I write a query in my vb.net form insert table...
2
by: Bob | last post by:
How do I extract the value of a table field and save it to a variable of similar data type in VBA ? Thank you in advance, Bob.
0
by: G.Esmeijer | last post by:
Friends, I have have filled a datagrid (flexgrid from C1Components) with the content of a textfile. Now I would like to save the content to an access table. I've tried the insert command I have...
3
by: MLH | last post by:
Generally, I do not monkey with renaming controls on forms whose name, by default, matches the name of their related table fields. But I noticed the following today If IsNull(Me!VColor) Then...
2
by: NowItsWhatever | last post by:
In query DESIGN view, how do I automatically "fit" the columns in the table/field grid to the lengths of the table and field names (including any functions applied to the fields). I am not talking...
0
by: amiteshs | last post by:
Hi Does anybody know how to save the rich textbox content to sql server 2000 database. I am using c#
1
by: Asking | last post by:
Hi all, how to save/read content of a RichTextBox to/from binary field in Ms.SQL Server ? I want to do save and read operation... I couldn't it Thank you
2
by: cephal0n | last post by:
I have this peroblem thats really bugging me for days, please have a patience to read it and help me find the probplem because I knew I missed it and just cant tell where. I have a table named...
3
by: adiel_g | last post by:
Hello everyone, I am trying to move a field name to a variable in vb.net. For example, first I retrieve the record from the database and save its value: .... userGroup =...
2
by: ZaphodBBB | last post by:
Hi It's about 2 years since I last had to write a database and I'm having difficulty with something I feel should be very simple.. I have a table called tblNew_Equipment with an AutoNumber...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...
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...

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.