Code:
Public Shared Sub Main()
Dim path As String = "c: empMyTest.txt"
' Create the file if it exists.
If File.Exists(path) = False Then
File.Create(path)
I want to create an attribute called "order_line_price", which is basically the quantity field * the cost per product.
I have written the following SQL query which works fine:
SELECT Order_line.order_number, Order_line.product_number, product_name, quantity, (quantity*price) AS [Order line price] FROM (Order_line INNER JOIN Product ON Order_line.product_number=Product.product_number) INNER JOIN Price_band ON Product.price_band=Price_band.price_band;
I can create a table from this query, and all is ok. However, I want to store the value of each order_line_price next in its appropriate row in my Order_line table. I cant do this no matter what I try. I know that what im trying to do is store a derived coloumn, however I need to do it, because I have an attribute elsewhere which is the SUM(order_line_price), which I want to limit by specifying the order_number for which to add the order_line_prices up for.
So basically, how can I store a derived column like that? I guess I need to set something up in the default value property and lock the coloumn or something?
Ive posted here before, and havent had replys. So if your reading this and dont know the answer, but do know the link to a forum or chat room with speedier replies, please post the link.
I have a table in msaccess which i would like to use as a search term to search values in another table. What i wanted to do is search the table with attributes and save all found attributes to a new table with its primary id.
Search_Keyword_Table Id ---- Search_keyword 1 ----- Size - S 2 ----- Size - M 3 ----- Size - L 4 ----- Size - XL
I would like to make some changes to the Northwind sample database.I need to have the Customers section completely removed as my company issues products to our own staff, not to external customers, so there is no Customers and shipping details needed.
At the moment i'm sotring the 'image_date' as an OLE object datatype. Is there anyway that i can get access to automatically populate the attributes 'resolution', 'created' and 'file_size'? or could this be done using a different datatype for the 'image_data' itself?
I was wondering if anyone might be able to help me here. I was trying to write up a technical report for the Access database i built. Are there an easy way of exporting all the tables with their attributes in Access?
For example, in the student table, ID FirstName LastName ...
I have a DB with about 50 tables. I have arranged them in a particular order in the relationship viewer and would like to print out as much of the viewer as I can by choosing the paper size and/or setting a scale factor. Access does not appear to let one do either. When looking at the relationship page, the 'page setup' under File ->Pagesetup is grayed out. Selecting 'print' causes the relationships to be printed in some sort of predefined manner, on 81/2x11 pages. Is there anyway to control how this view is printed?
On a related note: When in the relationship viewer, the only way to scroll the view is by the margin slider bars (the mouse wheel does not work). SHould the mouse wheel do the verticle scrolling? Also, if I want to move two or more tables (at the same time) in this view, how can I select them?
I'm creating a database of companies. Every company has at least one field of services they provide. There are three main groups which contain all the services (Let's say I have three tables).
What I need is to have a form/table (query?) where I can assign to a company any number of services from any group. Is it possible to do it in a form where I could simply add a service by choosing a group first and then a proper service, and then add more in the same way?
Recently I have started working for one of the company where I have to deal with one of the access file. this file has lots of tables containing many fields.
My question is
How can I get all the tables name, their fields and attributes in Microsoft Word file. I have tried opening table > design view and copy text but it doesn't work. also tries coping table and paste in in word file but it takes ages
Question: Is it possible, using VBA, to determine the actual Excel file type without opening the file?
I receive data files from other departments. Seems like every time someone changes their download structure, I end up with file types that do not match the download extension (example: xlm file with a xls extension). The files can't even be opened because of this. I think I can fix it if I could figure out how to determine what the file type really is.
I recently upgraded a DB from 2003 to 2013 and ran into the following problem.
I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.
In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.
Here's my code and a screenshot is attached.
Private Sub Command35_Click() Dim dd As Integer Dim fileDump As FileDialog Set fileDump = Application.FileDialog(msoFileDialogOpen) dd = fileDump.Show
I am using the following code to select files using Microsoft Office's file dialog:
Public Function fTestFilePicker() As String Dim fdFileSelection As Office.FileDialog, lstrFileName As String Const kInitialFile = "F:TestbedTest.txt" Set fdFileSelection = Application.FileDialog(msoFileDialogFilePicker) With fdFileSelection .AllowMultiSelect = False
[Code] .....
When I execute it, the file picker goes to the right folder but does not highlight the file test.txt even though that file name shows in the File name text box. Is there any way to correct this?
First off, I'm really new to all this so I'm a little overwhelmed. I know what I want but may not describe it well.
I'm just trying to get a basic issue to work.
If I have 2 databases, one which has names, and another which has information - in memo form. What I'm trying to do is create a form which will allow me to bring up a persons name and have the subform query the information database for all information (events) which have this persons name listed inside.
I have tried both filters and queries and while I can get everything to work if I type in text in the queries in and/or filters if I try to use the value of the name in the main form nothing ever works...
How to adjust the column width of the fields to best fit in a Query using vba codes? Manually it can be done by selecting the Query - Click on More dropdown of the Reports section in the ribbon - Click on Column width - and select best fit as the option.I want this to happen by a vba code and not manually doing it everytime because the field length changes as it is a dynamically created Query.
I am trying to make the + - (numpad) adjust the date of the current text field. The problem I am having is I believe the input mask intercepts the keypress and my keypress event is never fired. Here is my code:
Code: Private Sub LeaseDate_KeyDown(KeyCode As Integer, Shift As Integer)If (KeyAscii = 107) Then LeaseDate = DateAdd("d", 1, LeaseDate) End If If (KeyAscii = 109) Then LeaseDate = DateAdd("d", -1, LeaseDate) End If End Sub
Access makes the ding noise when I try and press + and - ...
I'm going crazy!! Someone who didn't really understand relational database theory (not like I'm an expert, but. . .) built a DB that is much more complicated than it needs to be. That person left and I got the job. I have to work with our IT people to hopefully redesign it completely (I would without asking, but they control the SQL server and the connection to the web.) but in the meantime, I have to work with a mess.
Okay, the question--I have to print a report of which organizations used which software company.
The table fields are:
Organization Comp1 Comp2 Comp3 Comp4
etc.
the answers are a "1" for a yes and a "0" for no in the "Comp" fields, so there is an answer in every field of a record. Essentially, it's a spreadsheet.
Off the top of my head, I know I could query each Company name with the court individually and then union query them all together. But isn't there any easier way? We're talking about 15 queries if I do it that way!
Anyway, thanks for any help you can give--this is driving me crazy (over 40 table set up in similar disarray. . . .)
I have now opened it in Design view and wish to adjust the width of the controls - text boxes etc but when I try to adjust one, all of the text boxes in that column are adjusted.
I'm having another one of those days but I'm getting a file path and file name from a dialogbox and forgotten when the VBA property is to return the full file path and file name.
This code works fine for return the filename only:
Code:
Private Sub TEST() Dim f As Object Set f = Application.FileDialog(3) f.AllowMultiSelect = True If f.Show Then For I = 1 To f.SelectedItems.Count MsgBox Filename(f.SelectedItems(I)) Next End If End Sub
Instead of using 'Filename' what else can I use to return what I need?
I've created an Access Report of a letter to be printed and mailed to customers. The majority of the letter is text, however there is a subform in the middle that will have a wide range of records displayed in it. This causes the subform's height to adjust from 1/2" to several inches, depending on the number of records. I need the text below the subform to start just below the last record in the subform, no matter how many records are displayed in the subform.
I have a database that I use to put in orders for our shop and keep track of our part informations as well as paint and packing materials. Everything works good on this but I am trying to create a table for adjusting quantities on hand for packing material based on the part quantities and for adjusting paint in stock based on information given to me after the job is run.
There is already a relationship between parts and packing material as well as parts and paint. When I put an order in I would like to have it adjust out that many packing materials that are related to that part. Once a job is run I need to be able to adjust out the amount of paint used.
For the paint side of this I want it to track the paint used by order, we are trying to get a grasp on how much paint we are using for parts so it is important for me to know how much and when.
I am thinking I need a table that connects paint to orders and has quantities in it, then create a query and do the calculations from there... I do not know how to accomplish that but it sounds like it could be right...
I have set up a report in Access. However, when I look at it in print preview, I get the message that the section width is greater than the page width, and that some pages will be blank. It is obvious that the Detail Section is the issue, but I can't figure out how to reduce the section width. The detail section only contains a few text boxes that are well within the margins of the other sections.
How do I adjust the section width so there won't be any blank pages?
Is it possible to make it so that whatever the dimensions of the image i paste the OLE object's frame will also be the same? I'm having a problem, not necessarily a problem more like a preference, I'm inserting pictures of each individual inside a database and whomever last took these pictures didn't make sure there was a standard size So all the images are different sizes and when they're put inside the OLE frame you can see the image inside it but the frame itself also shows its white background because the image isn't the full dimensions of the frame. I was thinking if it's possible to make the frame automatically adjust to the image's width & height.