General :: Pull Data From SQL Server Based Off Of Order Number?
May 27, 2015
I am looking into re-creating something I have created in Microsoft Excel into Microsoft Access.What I do in the Excel spreadsheet, is when I type in an order number, various fields in the spreadsheet are populated using vlookups and ODBC's.
I wish to re-create this in Access but not sure how. I have a basic form, with various fields such as, order number, part number, description, quantity.What I have in my mind is that I would like to be able to type in an order number, then the rest of the fields would be populated by a query to a SQL Server database.i can see a way to do this using VBA but would rather look for a more direct way if possible.
I have a module that is in Excel that is connecting to a back end database. I am trying to pull data from a table that meets a number of conditions. With the following statement, it is not returning any records,even though I know there are records that meet all of the conditions. I suspect the problem is with the last condition. In that condition I am trying to say that pull in records where it has been at least 14 days since the last review.
Code: strSQL = "SELECT tblsojrol_oc.* FROM tblsojrol_oc WHERE tblsojrol_oc.[Status] = 'Pending' AND tblsojrol_oc.[1st Review Date] IS NOT NULL AND " _ & "tblsojrol_oc.[3rd Review Date] IS NULL AND (DateADD(Day,14,tblsojrol_oc.[2nd Review Date])) >= #" & dt & "#;" objRs.Open strSQL, objConn, adLockReadOnly
I have an acces form to input client orders. Each order has its own order number a different client. On the same form I have a button to generate a report based on the inpuuted data on the same form which works perfectly fine.
Now I need to use same report to save each order in a specific folder on my computer in pdf format. However I would like to have the file generated as follows ordernumber "-" clientname.pdf. This way each order is saved in the same folder without overwriting the previous one.
i am going to use the autonumber as an order number but I want " SC2015 in front of it so i end up with " sc20151 , sc20152 but next year i want it to change the year SC201650 .how to put the sc2015 in my report without any input from the user
I am trying to create an auto-sequential order number
Example : AB000112 - AB is standard prefix, ''0001'' is the first invoice number, ''12'' is the year 2012.
so the next order number should read AB000212 and the next AB000312
Out of this, I have to issue several debit notes relating to the same order number when the payments are due from customers over a period of time, this will be
I am trying to add an attendance records to my database but cannot figure out how best to do it..I already have a 'children' table were all the kids info is stored and have created a 'roll' table.
i want to be able to open a form and search first and/or last name from the 'Children' table, then be able to save both first and last names and the date into the 'Roll' table. (then open reports etc later based on dates)how to pull data from one table and store it in another.
I am trying to create an expression to pull data from 2011 to present date. I need the data for 2011 to only reflect 1/1/11 through 10/7/11 (today's date in 2011). I need the same for 2012 and 2013.
I don't want to have to enter dates each time I run this, therefore, a formula would be preferred rather than hard numbers.
Im using ms access 2010 and this program compatible with previously ms access.the error show is type mismatch (error 13) on
Code:
Set rbs = CurrentDb.OpenRecordset("SELECT MSysObjects.Name" _ & " FROM MSysObjects WHERE MSysObjects.Type= 1 And MSysObjects.Flags=0" _ & " and MSysObjects.Name='" & n_tb & "'")
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.
I wish to produce a delivery note which needs to print an empty box for manually ticking.
I need a box for each item quantity i.e 5 items on the job print 5 boxes. 20 items print 20 boxes.
I have been able to use very crude code if there is only a few items, using if qty =1 then / 1/ else if qty = 2 then / 1/ / 2 / etc etc ...
That works and prints the / 1 / 2 / which is ok but there must be a simpler way as it the job has more that it would be much better and far more useful for other reports to print a box or item.
I have a report that I am trying to complete based on several queries. I am trying to count the number of records based on certain criteria and using the following DCount.
=DCount("[Calculated time]","IPG1","[Calculated Time] <= 0.04" And [Ship-to party] In ("SN00207PJZ","SN09162XXX","SN09324XXX"))
I want to count the number of IPG1 records that are under .04 and have the Ship-to party of the ones listed. I have tried everything that I can think of to get it to work but can's seem to get it to. I figure it's something easy but I don't see it.
I have 3 tables invoice, customer and items. I need to create a query that will get the next invoice number from the invoice table and mark that invoice number in the items table for a set customer where the invoice field in the items table is blank.
The invoice table is now set up as a autonumber, therefore I need to append to get the last new number.
The items in the item table are unique and this is why I want to mark the invoice number in the item table field invoice.
I need to first generate a random number between 1-4.
Then I would like to use that number to pull that many records out of the database; the records pulled can be random, or whatever.
For example, we have 4 people and my goal is to choose a random # of records to pull for each person. So, for person #1, it might only pull 1 record, then for person #3, it may pull 2 records, etc.
Ideally, it wouldn't pull the same # twice when run for that "session".
After this, I'm hoping to generate all those results into emails (eg for person 3 it would generate 3 emails, etc)
Currently it's all done manually and I think it's doable with Access.
I have some code already for generating "1" email message, but do not know how to pull X number of emails all at once. (X is the random #).
I built a report that provides all of the open support tickets. My idea is to have a button (Which I called "WorkIssue_Button") that displays beside each record that is populated on the report... I need this button to be able to pull the ID number of the record (Called "ID"). I then plan on opening a form that is preloaded to this record. How to pull that information?
I have an MS Access accdb with linked SQL Server 2012 ODBC tables. I am working on a procedure to copy data from local tables to these linked tables (identical schema). I did a simple
Code:
DoCmd.RunSQL "INSERT INTO linkedTable SELECT * FROM localTable"
This works, but is very slow. Way too slow. (INSERT copies the data one record at a time).
I would like to copy the data in a bulk operation, or operations that I can execute programmatically.
My report is grouped by a Billing Group #...within each billing group there are sub invoice numbers that are tied to the main billing group # (they all have the same billing group # but different general invoice numbers). I need to pull data if one of the general invoice # invoice dates is greater than or equal to a specific date entered.
In other words: If a Billing Group # and one of the Invoice Dates is greater than or equal to a specific date entered then pull ALL GROUP data to report.
I have a form (form1) that will populate with records (table1) based on key fields of "Project Number" and at time-points we will update part of the record, and then we create a word document detailing the updates with a couple of other bits of information not in original record.
Basically I want it to go from the original form (form1) into another form (form2) (via a command button) taking the key field of "Project Number" where it will ask the bits of information that we don't need have already and the contact person.
I have got this to store in a different table (table2) using a key field of just "ID" from the original records (table1). A list of contact people are in a separate table (table3) using a key field of "contact name" which will include other details for them such as address and phone number.
So from "form2" I would like to produce a report that contains information form "table1" based on the "Project Number" and "table2" based on "ID" as just been generated and "table 3" which is based on "contact name".
So I want to pull information form the records based on the certain key fields but struggling for it to pull it successfully...
Got relationships between: "contact name" fields in both "table2" and "table3" "project number" fields in both "table1" and table2"
In a query for the report I have all the appropriate fields, but only have the "contact name" and "project number" from "table2" is this right? or do I need both in?
Or would it be easier to draw all this information into "form2" but don't really want to select that many drop down boxes or would it be able to pull it from the "contact name" and "project number" boxes????
I have 2 tables. One has employee info and the second has time data based on thresholds reached in the employee info. Obviously, a basic join will bring in all of the threshold records. How do I get it to only pull in the one that satisfies the threshold condition?
I am having a problem to get my query to run properly. I have a huge IIf statement that doesn't seem to be working but I am not sure what is wrong with it. What it is supposed to do is return a good, actionable, or poor based on a specified weight and an actual weight. So what the query does is pull information from a table based on the specified weight and then using that information it should give back the correct rating in the last column.
Table called "Products" Field 1= "Product ID" which is a text field (PK) but numbers are used (ie 1 -20) Field 2= Products -showing our list of 20 products
When I enter a new product, currently I have to look in the table to find the last ID used then use the next one available. I have created a form to be used for data entry to enter new products
What I am trying to do is :- 1, have the form open at data entry level but still able to scroll and see all records and 2, Have the form auto generate the next number available. For example, I have 20 products entered so when the form opens to enter a new product, the ID is automatically at number 21.
I wondered if its because the field is a text field or I am trying to insert the code in the wrong place.
I wish to extract data from my access database...namely all packages we are taking to the post office for dispatch that day. The post office form looks like this...
I need to extract the name the address & postal service used (this data is all contained in our access database. I envisage using a 'flag' to trap those orders that haven't been posted yet (in other words export only those database entries that have not been flagged as posted, then afterwards update the database to change the flag to 'posted')
My dilemma is that I've not really used reports much (I'm assuming that reports is the correct way to go here)...how do you format the output of a report, when you don't know how many lines are going result (some days might see 10 order, other days 20 ...and so on)...
I've used MS Access a fair bit in the past but am somewhat lost since moving to 2013Pro.Some years back I was using software to document radio intercepts, this was based on Access but used a program to display and enter the data.That program was lost after upgrading to a new computer (tied to the CPU) .And the company has long since gone out of business.So I am left with the MS Access elements.In the form of a 3mb database that has nothing but a long list of tables to show for itself.Each table opens and has some ID columns with text like this in them 'L096e0dd24757c 1533a7cc1 53e 6ba44 bd' and after has usable data. What I want to do is set up Access so I can use as much of the data as possible.
First of all I hope this question is relevant to this part of the forum, I thought this was the best place to put it, but my ignorance of the subject may mean it ends up being more closely related to one of the other areas.
I'm struggling with some statistical reporting on Email Enquiries, which I'm currently doing manually using Advanced Find in the Outlook Public Folders and putting counts into an Excel spreadsheet. I find the whole thing quite ackward (as you might imagine), and the Advanced Find in Outlook frustrates me as it can be quite limiting.
What I'd like to do is set up an Access Data Project as a front-end for the Exchange folders concerned. I'm pretty well versed in MDB's but I've never set up an ADP before. I assume this is possible as I'm under the impression that MS Exchange is basically an SQL Server database. Is this correct? Will I be able to configure it using the Wizard that appears when I create a new ADP (if given permission by the MS Exchange Admin)?
I have a "Currency" field in a table and it holds large numbers (on which I will need to do basic arithmetic operations at some point, so I must store them as a numbers). I have set the "Standard" format on the TextBox used to display it on a form because I want to have thousand separators; I've also set "0" for decimals as I don't need to display them.
So everything displays as I want it even with the largest number that can be stored all the decimals are showing in the text field, but when I click on the field to edit the value instead of having the complete value it is displayed as scientific notation. I would like to display the complete value when editing it instead of the scientific notation, how can I achieve this, if it is possible?
A numeric example: If a user enters 1234567891012, the value displayed is indeed 1234567891012 but if they click on the field again the displayed value while editing is 1.23456789012E+11 (and it switches back to normal notation when the focus changes to another field). I would like to show 123456789012 all the time. I know that Access is capable of it most likely because if I set the Format to "Fixed" the values are always displayed completely (no scientific notation), but unfortunately I would like the thousands separators to show and it is not possible with the "Fixed" format.
Two last details, the scientific notation while editing does not kick in unless there is more than 11 digits in the number and the field width (and/or TextBox width) are sufficient to display up to 20 digits.