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

Adding data to field

266 256MB
I have a form and would like with the push of a command button for data to be sent to a comments field based on data entered in a different field. (ex- if field 1 is not "ok" i want the comments field to say "field 1 is not ok") If there is something in the comments field already i dont want it to be replaced with the new data... i want it to be added to it. is this possible? thanks
Jun 15 '12 #1
1 1327
beacon
579 512MB
The short answer to your question is yes, it is possible.

You will have to add the Click event to your command button. I'm going to assume a couple of things about your form, the fields on it, and the table you're using. Keep in mind that you'll need to change my assumptions to match your naming conventions in your database.

Expand|Select|Wrap|Line Numbers
  1. //Assumptions
  2. Command button name: cmdStatusCheck
  3. Field to check: txtStatus     //This holds the value "Ok" or "Not Ok" - you called this Field1
  4. Comment (text) box: txtComments
  5.  
Now for the code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdStatusCheck_Click()
  2.  
  3.      If txtStatus <> "Ok" Then
  4.           If txtComments = "" Then
  5.                txtComments = "Field is not ok"
  6.           Else
  7.                txtComments = txtComments & " " & "Field is not ok"
  8.           End If
  9.      Else
  10.           MsgBox "The field is okay and no comments will be added.", vbInformation + vbOKOnly, "Add Comments"
  11.      End If
  12.  
  13. End Sub
  14.  
Jun 15 '12 #2

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

Similar topics

3
by: Funnyweb | last post by:
When adding a field to a table using ALTER TABLE is it possible to check if the field already exits before the ADD command is run? If so how do I do this? Thanks Hamilton
1
by: ccr | last post by:
Please view in a text editor so that the columnar text lines up. I used Terminal 9pt font to compose this post and copied/pasted to my newsreader program. I am writing in the hope that one of...
1
by: ccr | last post by:
Reposted with a longer line length. Apologies if I did not cancel the 1st attempt before you got it. If necessary, please view in a text editor so the columnar text lines up. I used Terminal...
1
by: gary | last post by:
How do you add a field to the begining of the recordset. I need the new field to be the first field. Thanks
3
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
10
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to...
14
by: Karl Irvin | last post by:
While adding data to a record set, I use something like rst! = some variable rst! = some variable ...... rst! = some variable The rst! , rst! etc. are manually typed in and it gets...
1
by: BigLebowski | last post by:
Hi all, I have to insert in a data field a value composed by a date and a time, that are stored in another table my problem is that the date is in a field (a data field) and the time in another...
2
by: s4lin | last post by:
problem is pagination not retaining data field i have form with general data field, and i need to select some option which is store in database, so i open another page with retrieving data from...
4
by: Wayne | last post by:
I've used a data field as the rowsource for a combo box many times. The main advantage that I see is that a separate table of say, "Customers" does not have to be constantly updated. When a new...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.