SQL "CREATE TABLE" Command Issues With Table Formatting
Apr 16, 2007
Could anyone suggest a reason why writing an SQL command "create table" in visual basic would successfully create a table *but* change the way the data is stored in the fields?
For example, if I created a table with one field:
strSQL = "CREATE TABLE whatever ([MyField] char(20));"
DoCmd.RunSQL strSQL
And enter the data: "Test"
Why then would the whole 20 spaces be used, the first four with the letters I entered, and the rest with 16 blank spaces I never did? If I highlight them and delete them, then rexamine the record, they are still there.
Any suggestions appreciated! :D
View Replies
ADVERTISEMENT
Nov 4, 2014
I have a make-table query that pulls all the fields from 1 table (MainTable), and creates a new table with a date stamp based apon a form value entered (New Table = MainTableWithDate).
Currently, I setup the query to pull info from the form field like this:
DateField: [Forms]![frmmain]![DateField]
However, when the make-table query is done - all date fields are blank (all other fields are correctly created), and when I look at the new created table (mainTableWIthDate), the typeassigned to the date field is "Binary" (in the form, I've specified LongDate).
View 6 Replies
View Related
Jun 4, 2015
I have three tables that contain different columns but linked by a primary column call Name. I want to create a table where all these different columns in the three tables join to form a master table which can be updated regularly either through the master table or the smaller tables. The master table also has the primary column as Name.
If I update the master table with records, it should update the respective linked table and vice versa. I also want to link these tables to my SharePoint site.
Note: except the Name column, none of these tables have any other columns in common How do I go about this?
View 7 Replies
View Related
May 1, 2012
Here is what I am trying to do: I have form, and a table which is created from this form. The data is entered a second time using the form to make sure there are no discrepancies.
Any easiest way to implement this? (create a new table (which is duplicate), and then compare them?
View 5 Replies
View Related
Jul 19, 2012
I have two tables. The first one is as follows:
MP No (Primary key), Sales, Date Entry, Specs, Email
The second Table is as follows:
MP No, Quantity, Description, DWG, Price
There is a "one-to-many" relationship between the two tables through the MP No field so whenever I go to the first table there is a sub-table for each MP No. Correct?can I create an extra sub table under the sub table already created?
View 10 Replies
View Related
Oct 20, 2006
I'm a relative newbie to the more advanced features available to Access.
If someone could help me or point me in the right direction, I'd really appreciate it.
I have one table that contains companies and associated contact info. Each company can have more than one unique number ID (3 digit alphanumeric).
I want to take this table and run a query to create a new table that will only have one instance of each company name, along with the other contact information. The unique ID's aren't needed in this table (but it would be great if I could somehow toss them in, too).
This new table would then be used to create a form with a combo box containing all of the names to quickly jump to their contact info.
Any and all help would be appreciated. If a query isn't the best avenue for this, then please point me in that direction, too.
Thanks!
View 5 Replies
View Related
Dec 7, 2006
Hi there :)
I'm not sure if I've picked the right forum topic for this... It's not a straightforward table question, and I think the only way I can do what I need is with a query of some sort. Apologies if it should have gone in 'Tables'...
The situation is: I'm creating a database (using Access 2003) in which our secretaries can enter exam marks for students. The difficulty is that there are ten papers (exams), each student's exam is marked by at least two examiners and there are at least 6 examiners per paper. Every examiner also marks more than one paper, but doesn't mark all papers.
So, I've got a table with all of the examiners and the papers they're marking and I've got a table with all the students and the papers they're taking. Because we have to enter the marks in such a way that we know both which mark an examiner gave and (obviously) which mark a student received (e.g. so we can look at statistics for each examiner), I thought the best way to do this would be to run a query that created a new table per paper in which the field names would be: Student_ID, <name of examiner 1 for the paper>, <name of examiner 2 for the paper>, <name of examiner 3 for the paper>, etc until the end of the list of examiners for that paper. The student's number would populate the Student_ID field and then the secretaries would enter each examiner's mark in their named field. Like this:
| Student_ID | A.N. Other | J. Blogs | J.Q. Public | Agreed_Mark |
1234A 72 74 73
2345B 65 68 67
3456C 71 73 72
4567D 52 51 52
Listing the name of every examiner (including those who aren't marking that particular paper) isn't an option (and would have to be hard coded into a table in any case, as far as I'm aware, either in a query or in a table design. This is something I'm loathe to do). Ideally, the secretary would be able to press a button on a form and have all the mark entry tables for all the papers created automagically.
The examiners for the different papers change every year, and not every academic marks exams every year, so this data will not remain static. Hard coding a table with examiner names would make more work for the secretaries. (I want to avoid this as all mark entering for all students is done in a single day. This means over 600 students at 3 marks per student [mark 1, mark 2, and final agreed mark] with time to contact examiners with questions... and only 2 secretaries, each of whom deals with a different section of students).
Because of the nature of the marking, it would also make quite a lot of work for the secretaries if we had to cross reference a generic Examiner_1 field with a different examiner for each paper, so the field name really must be the examiner's actual name.
Can anyone help me? I'm happy to do it with either VB or SQL; I'm not a programmer, but I can usually work out what code does even if I can't write it myself. I should be able to adapt anything presented as long as it's complete and doesn't assume that I know the basics. :) I've also got two reference books to hand: _Microsoft Access 2003 Forms, Reports and Queries_ by Paul McFedries and _How to Do Everything with Microsoft Office Access 2003_ by Virginia Anderson.
Thanks very much for your time. :)
-Jen
View 10 Replies
View Related
Sep 30, 2013
I split my db to front-end and back-end. 20 users are using the database. But now I have the problem: In my admin front-end db I created a new table and some reports to the table, but this new table I have only in my front-end db and it doesnot appeares in back-end db - so that other users has no data in hte report for the new table. How I can create new table to be in back-and table too?
View 5 Replies
View Related
Jul 15, 2007
Hello, i have a excel spreadsheet that has a column with a persons surname (comma) and firstname i.e Steve, Jones.
I export this spreasheet in Access, but would like to splitt the surname and first into separate columns in the table.. whats the easiest way to do this?? Thanks
View 2 Replies
View Related
Apr 13, 2005
I am trying to create custom "icons" using values retrieved from an access db. Right now, I'm pulling records that match the user's name(Fname) or "default", then assigning the returned values variables and plugging those variables in as the image, URL, and title of the "icon". The problem is that this setup will only retrieve the first record from the db that matches "Fname" or "default" and I want to create seperate "icons" for each record that matches "Fname". I can pull all matching records using the maketable(), but then I don't know how to format these as I have here to make additional "icons". My source code is included below:
Code: <% if Fname <> "" thenopencnset rs = Server.CreateObject("ADODB.RecordSet") SQL="SELECT ID, Date_Time, URL, Icon, Title, Description, Status FROM Submission WHERE Technician ='" & Fname & "' OR Technician='Default'" Set rs = cn.Execute(sql, , adCmdText)ID = rs.fields(0)URL = rs.fields(2)Icon = rs.fields(3)Title = rs.fields(4)rs.closecloseCNend if%><a href="<%=URL%>" target="new"><img border="0" title="<%=Title%>" src="menupics/<%=Icon%>.gif"></a><br><font color="#FFFFFF" face="Arial" size="2"><%=Title%></font>
Any help anyone could provide on this would be greatly appreciated. Thanks in advance. -Chris Gordon
View 1 Replies
View Related
Oct 5, 2007
I have to create a new table for some data I have from work. The data was imported within quotations though, so it won't let me copy and paste it untill the quotes are removed. I have over 3000 data values in each column, so I can't just go through and delete every quotation mark. Is there any way for me to select a column and remove the quotations around every value?
I have the XP version, by the way.
Thanks !
View 7 Replies
View Related
Mar 31, 2013
In a table, I would like a particular field to look thusly:
xx-xx-x-x-x
My question is how do I format it so that the dashes (-) are automatically inserted when the data is keyed into the input screen. The dashes would also have to be displayed on the table.
View 2 Replies
View Related
Jul 22, 2015
1. Can we have the cells within access table change color when their input changes as in excel? For Ex:
If the input for a cell inside Column "Status" says "Pending" then the cell color is orange.If it says "Completed" then color is green?
Is this possible on Access?
2. Also is it possible to change the color of Column headings?
I tried changing the color but found that the entire table changed colors with alternate rows.
View 7 Replies
View Related
Aug 21, 2013
What I want to be able to do is have a button next to every client entry which the user can click. Once the button is clicked, I want the "person name" box in the report to be formatted to have a yellow background.The purpose of doing this is so after a couple of days when we come back to the report, we can easily see by the yellow background which people we have to follow up with.
I don't think conditional formatting will work because I have so many different "person names" in the report that it would go above the 3 rule limit, only solution in VBA.The button I created is called "Format", and this is the VBA code I have tried:
Private Sub Format_Click ()
Me.Person_Name.BackColor = vbYellow
End Sub
View 2 Replies
View Related
Jan 9, 2007
Hi all
the problem i am facing is that the table exported by ACCESS to EXCEL is without any kind of formatting, bold text italics etc. , is there any way i can make access export the excel file with bold column headings and the cells having solid borders(basically any formating i wish to give).
Each time i export the table i have to open excel and format the spreadsheet giving headings highlighting stuff and all and it is very troublesome so i did make a macro in EXCEL for it but i still need to open the file in Excel and run the macro. is there some way to run that macro during the export process so that the user just gets the file in the format he/she wishes.
thanks for you help in advanc
View 1 Replies
View Related
Nov 4, 2013
I have a table in access and I need to format it so that when column "Status" = "Closed" column "Closed" = "yes". so it will automatically mark column "Closed" "yes" if "status" says "closed". Instead of having to change both columns all the time.I know how to do that in MS Excel, but is it possible in MS Access 2013?
View 3 Replies
View Related
May 22, 2013
I have been using Access for several years but always in a basic way. I have started work on an existing Members database where the Members Addresses have been pasted in from Notepad or been imported from csv or manual entry.The ones that have been manually entered are on one line. The ones that are imported from csv or pasted from Notepad are on multiple lines like you would naturally type on an envelope..In Notepad they look like this:
'Oakdale' 123 Expression Road
Name of Town
Name of County
Postcode
Sometimes the addresses have 4 lines and sometime they also have the name of a village which makes it 5 or 6 lines. When imported into Access they also view (datasheet view) in the same way with the return at the end of each line. However, I cannot enter a new address in this manner directly into Access.How can I enter the address text into a text filed and be able to format it so that it looks like the above?
I have searched many times for an answer to this but cannot find a way of explaining it that search engines understand. I first came across this 12 years ago when I worked on a massive Members database for a radio station all the addresses where formatted in the same way and had been imported through csv. When I do this the csv file marks up the text as "'Oakdale' 123 Expression Road□Name of Town□Name of County□Postcode"
I have tried exporting to csv ad then importing it into GMAIL and this works fine I have also printed off labels and envelopes and all the addresses print fine too; I just don't know how to input it in that format other than pasting all addresses through a basic text file.
View 5 Replies
View Related
May 11, 2015
I am trying to export into a temp table (all text fields because it will be going into a text export later) and I'm having difficulty adding 0:00:00 onto the value of "ApptdateLast" for the update...
INSERT INTO cbt_Export_Temp ( TransactionType, ID, ApptdateLast )
SELECT "Add" AS TransactionType, "BC" & [TransId] AS ID, dbo_Info.ApptdateLast & " 0:00:00" AS ApptdateLast
FROM dbo_examInfo
View 2 Replies
View Related
Oct 15, 2014
I have a form which basically has - employee, work done, hours and a calculated field (w/hour) of work done/hours
I can manually set the conditional formatting however as time changes targets will go up and it would be easier to update the targets in another 'admin form' (i can manage that part)
Its just referencing the other table to say the likes of :
if work per hour is greater than tbltargets.convtargetmid then vborange, if work per hour is greater than tbltargets.convtargethigh then vbgreen else vbred.
View 3 Replies
View Related
Jan 27, 2015
While using append Q I lose formatting information in destination table.
How do I transfer the formatted information with out losing it when using append Q?
I am new to access so VBA code is not an option for me.
See image below.
View 3 Replies
View Related
Oct 6, 2014
I am using VBA to execute a 'Make Table' (named 'DT'). One of the fields in DT (named 'Dollars') contains numbers that have 6 to 8 digits; some are positive and some are negative.
These large numbers with no commas (or parentheses when they're negative) are incredibly hard to read.
Any VBA coding that will change both the "Format" and the "Decimal Place" Field Properties on the table I make (i.e. "DT"). I want to the Format property to read (#,##0.00;(#,##0.00)) and the Decimal Place property to read "2"). This will allow me to display a number like -10326786.41 as (10,326,786.41) which is incredibly more readable.
Is it possible to do this programmatically; I've search the internet high and low and could find anything remotely useful.
View 8 Replies
View Related
Apr 27, 2007
Is there a way to have a command button on a form, when pressed change all fields in a Table to show unchecked? I am using a Table that has nothing but Yes/No fields in it. If this is possible, what might the code look like? Table name is "InputH-1".
You guys/girls are awesome! Thanks in advance for all your help!
View 3 Replies
View Related
Sep 3, 2004
Can I use a command button to display my table? If so, what code needs to be used?
View 2 Replies
View Related
Aug 26, 2005
Dear All:
I would like to use a command button on a form to open a table. The name of the table is called "MAJORCODE"
Any suggestions?
Many thanks,
Dion
View 5 Replies
View Related
Nov 2, 2006
I have 2 tables, one has a list of comments indexed by numbers.
The second table will be populated with numbers that correspond to the first table based on usage of the form that I'm about to describe.
The form contains several check boxes. Each corresponds to a comment from the first table. If 3 of the check boxes are selected when the command button is pressed, I want three separate new record entries to go into the second table and the data that I want entered is the text in the label that is next to each check box on the form. After the records are added to the table, I'd like to reset the check boxes.
I simply cannot figure out how to code the button to do this.
View 3 Replies
View Related
May 4, 2015
I made a Point of sale using a form with different sub-forms which have command buttons on it. They basically run a append query from tblStockMain to table cash and on to transactions. That works all fine no problem.
The one missing thing to make it sweet is to rename the command buttons automatically from tblStockMain. With other words, if I change a product in the table it would change the name on the button and the picture if possible with it.
Is there a way to do it?
View 2 Replies
View Related