General :: Insert Two Values Into A Cell
Oct 19, 2012
I have a table which holds the status of peoples orders. It holds information on order_id, order_status, order_desc, letter.
A letter is printed for each of the different statuses. However for one status i need two different letters to be printed.
How can i insert two values into the same cell.
So far i have done
insert into order_status (order_id,order_status,
order_desc, letter) values('025', 'Dispatched', 'Black tailored coat ','DPT notification');
This prints the DPT notification fine but i need another letter to print along with this.
View Replies
ADVERTISEMENT
Jun 15, 2013
I am trying to insert a new line below the active cell ive tried several attempts but i am getting error 1004. Some attempts are commented out.
Code:
wks6.Activate
With wks6
.Select
' .Rows.AutoFit
' .Columns.AutoFit
.Range("A:AO").Select
[Code] .....
View 6 Replies
View Related
Aug 18, 2015
I have imported an Excel table with a column which has several values in one cell separated by "". In my case names of institutions afiliated with a patent. Example of the format of a single cell: MASSACHUSETTS INSTITUTE OF TECHNOLOGY (US) RIVE TECHNOLOGY INC (US)
In order to normalize the Access database I would like to extract the institutions to a separate table (institutions) and that the patent is related to both institutions.
I am using Access 2007.
View 2 Replies
View Related
Jun 2, 2014
I have a button on a subform that becomes visible if there is no records in the source of the subform. When clicked I want to run a query that will insert a record on to the source of the subform. There is one field in the query that I need to get from the parent form.The first part works OK - the button is visible when the source file to the subform for this main form record, is empty.
If I run the query against the source file it inserts the new record after it has asked for the value of the variable field.My problem is that when I try to run the query when the button is clicked It can't find form![ClientFileFrm]![ClientId]..This is my code on the subform
Private Sub Form_Load()
If Me.RecordSource <> "" Then
If Me.Recordset.RecordCount = 0 Then
Me.AddSettingsButton.Visible = True
[code]...
The ClientFileFrm is the main form.I can't seem to reference the clientId variable back to the main form.
View 1 Replies
View Related
Sep 20, 2012
I'm using Access to export the results of a query to Excel and within the same code I am opening up the spreadsheet to format it. Part of the formatting requires me to find the first empty cell in column A, and then insert the text 'Summary'.
Within Excel, the following code works:
Find empty cell:
Code:
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
Add term 'Summary' to cell:
Code:
ActiveCell.FormulaR1C1 = "Summary"
I've tried a few different things based on some code I've found on the net from similar situations, but in just about all attempts I get an object defined error. I've tried dimming the piece of code as an object, but when it comes to VBA, I'm just fumbling through.
View 1 Replies
View Related
Mar 17, 2014
I have a simple form (frmAddPaper): txtPaper where user enters name of new newspaper, and cboCity, where user selects the newspapers town.
Also Close and Save buttons.I also have a table, tblCity. Columns as follow: CityID, City, Paper1, Paper2, Paper3, Paper4, Paper5, Paper 6.
Some cities have values (Newspaper names) in just Paper1 field. Others in Paper 1 & Paper 2, and some in Paper1, Paper2 and Paper3.I want to add the txtPaper value, to the first empty column, in the row where cboCity matches City column.
View 14 Replies
View Related
Jan 9, 2007
Hello!
I have "ID" column and I want to create new column called "ID_new" where the value of each record should be "1000" plus the value of "ID".
For example:
First record, has "ID"=1, than I want "ID_new" to become = 1001
Second record, has "ID"=3, than I want "ID_new" to become = 1003
etc..
Any tips/hints?
Thank you in advance & best regards
noah
View 4 Replies
View Related
Jan 30, 2014
Is there a way to write different numerical values in single cell of table via form.
View 2 Replies
View Related
Nov 11, 2013
What's the best way of storing arrays of data within a cell? Or should I be creating fields to the size of the array.The size of the arrays are unknown at the moment.
View 7 Replies
View Related
Jan 9, 2014
My friend extracted some text from a PDF file, pasting it into Excel, and needs to find certain pieces of information. Problem is, the text came out as a long string instead of being broken into cells.
So, what we need to do is find, within the text, the 1st, 3rd, 5th, 7th, 9th, 11th and 13th times the word "Principal" appears, and then report back the name that follows. Within the text, it would read something like
(1234 Principal John Doe)
The number in front of it will change or be in a different format, there are other parentheses in the text (varying number of times within the text), and the name changes, of course. We want to extract the name following the word "Principal"... but only the odd-numbered times they appear. Some cells will have as few as six "Principal" entries, others as many as fourteen.
View 5 Replies
View Related
Aug 18, 2012
The Format Painter seems not to work in Access 2010.The Format Painter button is not in Home / Text Formatting, where you might expect to find it.I create a New Group and add the Format Painter icon. I cannot then use it. It stays greyed out.I add Format Painter to the Quick Access menu. It stays greyed out.If I view a form in Layout mode, I can sometimes get the Format Painter icon to highlight - but I cannot select just a single cell whose format I wish to copy.
Where use of the Format Painter is documented..How to do a very simple thing: copy a format from one cell in a subform to another.
View 3 Replies
View Related
Feb 25, 2013
I have 2 gig of order data which has duplicates due to different invoice dates. How can I combine the dates into one cell so I only had one row of Order data.
i.e. order number, price, order date, invoice date
same order number, same price, same order date, different invoice date.
How do I combine the second line with the first so that I only have the data once.
View 10 Replies
View Related
Jul 9, 2013
I have subform (Datasheet) is there some code e.g. after update, which can adjust size cell to lenght of data?
View 11 Replies
View Related
Jan 18, 2007
Hi
I am creating an employee db, with fields including employeeID, surname, firstname, partnerSurname, partnerFirstname, partnerID. As some partners work at the company, I want the partnerID to list (thorugh a value box) employeeID's that match surname to a partnerSurname and firstname to partnerFirstname.
Is this possible? Any help greatly appreciated.
Thanks in advance.
View 1 Replies
View Related
Apr 28, 2007
My thinking must not be right as I can't get this to work but i have a table with
Date AMT
02/05 50
02/06 20
and soforth....
I am summing up each week and putting this in a table with values
WeekBeginningDate WeekEndingDate SumofAmt
I am trying to do
INSERT INTO tblTwo ("02/05/2007", "02/09/2007", SumOfAmt)
SELECT sum(Amt) FROM tblOne
where TDate >=#02/05/2007# and TDate <= #02/09/2007#
The two dates in the INSERT INTO are just values and the SumOfAmt is from the select. Can someone help me with this? Thanks in Advance!!
View 2 Replies
View Related
Nov 22, 2006
Hi, this is my first post in this forum... so thanks all for your answers...
Ok, the problem is this...
I've got a database with some tables, but in that database i've got 3 important tables....
Lets refer that the tables have this names [Table1,Table2,Table3];
In the Table 1, there are 3 important variables, one of them its a primary Key, ok all i wanna know how to do... its this:
When i insert a new regist in this table, the first 3 values from the first three colunns must be replicated to table2 and table3.
Can you help me PLEASE!! :(
View 10 Replies
View Related
Apr 9, 2007
Hi All
I have a list box. Below it lies a text box.
I'd like to click on multiple values in the list box which then populates a text box with each value to form a sentence.
currently my code looks like this
Dim Comment As String
Comment = Me.lstComments.Column(0)
Me.txtComment = Comment
Using the above method only inserts one value. How can I modify this to insert multiple values into the text box?
Much appreciated
View 4 Replies
View Related
Jun 7, 2013
I'm now trying to speed up data entry within my database and have hit a brick wall with one part.Basically, this is within a form (for 'clauses') of which there is a one-to-one relationship with 'the Applicability' table (a series of fields with 'Yes/No' values for each and a related key field) - i.e. for each clause there are a series of circumstances when it will apply. I've set this up to create a record when one doesn't already exist using the default values (i.e. all applicable).
The method to speed up data entry is to have a pop-up form with unbound fields to list common Clause fields - including 'Applicability' as a subform. When entering a series of Clauses you tend to find they have the same 'Applicability' as their neighbour, so I would like to create a corresponding record in the Applicability table with the values set on the 'ClauseQuickAdd' form (Technically the 'ApplicabilityQuickAdd' sub form).I've edited an existing code within my database to provide two global variables (strAppFieldList and strSubAppFieldList) to put into the following statement:
Code:
DoCmd.RunSQL "INSERT INTO Applicability ( AppRelClause, "" & strAppFieldList & "") VALUES ("" & Me.Clause_ID & ", " & strSubAppFieldList & "")"
Bringing up Error 2498 "An expression you entered is the wrong data type for one of the arguments". So I presume that I haven't quite got the format right for transferring yes/no values (strSubAppFieldList). See below for an extract of strSubAppFieldList:
Code:
Forms('ClauseQuickAdd')![ApplicabilityQuickAdd]![Manufacturer], Forms('ClauseQuickAdd')![ApplicabilityQuickAdd]![Supplier], ...
View 6 Replies
View Related
Mar 17, 2014
i have a subform which contains a lot of calculated values. fields which calculate values are located both in master form and subform. i use those calculated values in various reports where i have to insert formulas again. so i have decided to insert calculated values in table directly. i can use update query but i am unsure how to trigger it; and how to keep fields updated everytime a value is changed.
main form fields = [gsm] , [rate]
sub form fields = [pages], [qty], [gsm]*[rate]*[pages]*[qty]
View 1 Replies
View Related
Mar 11, 2015
I am working on a timesheet application which allows users to insert multiple timesheet entries in a grid style format. the first row is visible and to add another row users click on a command button which makes the next row of fields available and ready to fill in and so on and so forth. I need the fields to be unbound and then when the user clicks on a save button for example then it inserts those values into the relevant table. Table name is tbltimesheet, field names are id, companyname, project, activitydate, activityhours, activitynotes, username, userid
View 2 Replies
View Related
May 20, 2013
I want to insert obtain marks of the subjects. Find the attached my db. when i select combo value my requirement is to insert the all records which associate with the combo. but when i select combo value it will happen nothing.
View 7 Replies
View Related
Sep 22, 2006
Hello guys,
Does anybode has any idea, of how to do that ? I can do it very easy in VB.NET, or C#, but in Access I give up.
So, I have to take data from the form , and send it to Sub.
With data type of String , I have no any problem, use Nz funciton, end everything, goes well.
But with Date and Integer, I can not find solution.
So :
Date
Dim PensionerFromDate as Date
PensionerFromDate = IIf(IsNull(Me.txtPDPensionerFromDate) = True, ????, Me.txtPDPensionerFromDate)
(instead of ???? i tried everything .. dbNull, vbEmpty, vbNull,sqldatenull, and somtimes it works but int the table stores "12/301899")
Integer
Dim CompanyID as integer
CompanyID = IIf(Me.cboCompany.Column(0) = 0, ????? , Me.cboCompany.Column(0))
I tried here instead of ????, tu insert "", ",," , " " , Cint("") itd. itd. . but nothing works.
Has anybody any idea ?
100 x thanks in advance
View 7 Replies
View Related
Jan 27, 2015
I'm trying to write some Code with the target to take a value from a textbox (out of a form) and a pregiven value (in this case = 2) and enter them in a new record in a table. But only if there is not already a record with the exact same combination of these to values. When done, the same button should proceed you to the next form (but this code is not already implemented in the fragment below) even if no values are added because they already exist in this combination.
Code:
Public Function GetID_PatientStudiesGroup&()
GetID_PatientStudiesGroup = [Forms]![frm_PatientStudiesGroupTZP]![ID_PatientStudiesGroup]
End Function
Private Sub BPRS_T1_Button_Click()
Call GetID_PatientStudiesGroup&
Dim strSQL As String
[Code] ....
As you can see, I tried to use a function to refer to the value out of the form, because I didn't find out how to refer to a form in an SQL Code.
Just to give you a better overview: The table where the information should be added is named "tbl_PatientStudiesGroupTZP". The form where you find the Textbox "ID_PatientStudiesGroup" (with the value I need to transport) is named "frm_PatientStudiesGroupTZP". Every part (except the WHERE NOT EXISTS part) worked perfectly for itself, but not when thrown together.
View 10 Replies
View Related
Nov 19, 2012
i am trying to insert multiple values that i have selected in my listbox to my database access table when i click the "add record button" but the values does not appear in my database table.
i have 2 listbox, when i select the first list box(businessNature) it will display the records in the 2nd list box(lstCuisine). However, the records in the the lstCuisine list box is not entered into the table in my database.
(ps: in my property sheet for my lstCuisine listbox its multi select is simple)
Here is my codes:
Private Sub Add_Record_Click()
If IsNull(Name) = True Or IsNull(Mobile) = True Or IsNull(Email) = True Or IsNull(CompanyName) = True Or IsNull(BusinessNature) = True Then
MsgBox "Please fill in Business Nature, Name, Contact, Email and Company Name"
Else
DoCmd.GoToRecord , , acNewRec
End If
Dim conceptValue As String
[Code]...
View 10 Replies
View Related
Apr 4, 2013
Is it possible to have a value in an excel 2010 cell be used to update an access 2010 db?
For example, if in a spreadsheet "test" cell A2=3 then in a db "test" a column "value" is 3. However, if the value in the spreadsheet changes so does the db.
View 1 Replies
View Related
Nov 21, 2006
i have a table of articles. A field in the table is ArticleSubject
the ArticleID is made up of 3 letters then 3 numbers. i want the 3 letters to be something according to the subject
for example i want the first 3 letters of the ArticleID to be MAT*** (* is a number) if the subject is Maths
or ENG*** if the subject is English
the subject is picked from a listbox in the same record
how would i do this in a table . i am reluctant to use append or update queries.
but will do so if its the only way.
View 4 Replies
View Related