ms-access-2007

Passing Query Parameter to Sub-Report

你说的曾经没有我的故事 提交于 2019-12-29 08:54:08
问题 It has been a long time since I have worked with MS Access and am not sure if I am doing this right. I have a Report bound to a query of single list of user names. The report groups on the user name and has a sub-report in the detail that is a chart. The sub-report/chart is based on a query that accepts a parameter of the user name. Since the sub report is not bound I need to pass the user name parameter from the main report detail onload event down to the sub-report and thus into the

Importing a text with separators using VBA

两盒软妹~` 提交于 2019-12-29 07:42:00
问题 I am trying to automate the adding of new text files, which all have the same (known) layout. The columns are separated using tabs (the TAB button). My question is, is it possible to do this in VBA? Like, in the access wizard for importing text files? I am using the DoCmd.TransferText method in VBA 回答1: You'll need to go through the wizard once to make your specification file. TO do this import your text file like normal but before you get too deep into the wizard click on the bottom left,

Import Dynamic and Static ranges from Excel in to MS-Access that do not start at cell A1

半世苍凉 提交于 2019-12-29 01:38:09
问题 How might I link a data range from an Excel spreadsheet so that the data in that range appears as a useable table in Access? Linking to an Excel sheet that has data starting at cell A1 is easy enough, but where data in the Excel spreadsheet starts elsewhere in the sheet, I'm not sure how to get Access to pin-point it, especially if that non-A1 range is dynamic. Access doesn't seem to pick up named/dynamic ranges when going through the import/link wizard. Real world scenario: I have an Excel

Store two Queries result in third variable

陌路散爱 提交于 2019-12-28 07:08:48
问题 What's wrong with this code: Visual Basic 6.0 With access 2007 Private Sub Command1_Click() Dim Sell_tbl, Stock_Bottle, res As String Sell_tbl = "SELECT Sum((Quantity)*12) FROM Sell_Detail Where Cateogry='Large'" Stock_Bottle = "Select Sum(No_Of_Bottle) FROM Add_Bottle Where Cateogry='Large'" res = ((Sell_tbl) - (Stock_Bottle)) Adodc1.RecordSource = Sell_tbl Adodc1.Refresh Adodc1.Caption = Adodc1.RecordSource End Sub Type Mismatch Error I try to convert its result in other data type but it

Store two Queries result in third variable

折月煮酒 提交于 2019-12-28 07:08:18
问题 What's wrong with this code: Visual Basic 6.0 With access 2007 Private Sub Command1_Click() Dim Sell_tbl, Stock_Bottle, res As String Sell_tbl = "SELECT Sum((Quantity)*12) FROM Sell_Detail Where Cateogry='Large'" Stock_Bottle = "Select Sum(No_Of_Bottle) FROM Add_Bottle Where Cateogry='Large'" res = ((Sell_tbl) - (Stock_Bottle)) Adodc1.RecordSource = Sell_tbl Adodc1.Refresh Adodc1.Caption = Adodc1.RecordSource End Sub Type Mismatch Error I try to convert its result in other data type but it

MS Access 2007 - Cycling through values in a list box to grab id's for a SQL statement

梦想的初衷 提交于 2019-12-28 06:52:05
问题 Lets say I have two tables, one for transactions, and another table who's primary key is the foreign key in the first table, and this relationship simply associates locations to transactions. I have a form with a list box that shows all the potential locations, so that the user can open some dashboard forms that only pertain to a given location. So I know how to pass the data from the selection to the dashboard, however I would now like the user to have the capability to select multiple

Record cannot be read; no read permission on 'MSysObjects'

陌路散爱 提交于 2019-12-28 06:23:07
问题 I'm trying to get a list of all tables from an Access 2007 ACCDB format database using Excel VBA. I have followed this post: How can I get table names from an MS Access Database? Using: SELECT MSysObjects.Name AS table_name FROM MSysObjects WHERE (((Left([Name],1))<>"~") AND ((Left([Name],4))<>"MSys") AND ((MSysObjects.Type) In (1,4,6))) order by MSysObjects.Name but I'm getting this error. Record cannot be read; no read permission on 'MSysObjects' I want to be able to get the table names

Save password for ODBC connection to MS SQL server from MS Access 2007

非 Y 不嫁゛ 提交于 2019-12-28 06:16:05
问题 I am in charge for migrating old Access 2007 project to MS SQL server 2008 Express. The first stage is to move all the data from MS Access database to SQL server while keeping the Access forms and reports at the client. So, the data are now moved, an SQL server user (for accessing only that particular database) created, and the tables are linked the Access database via ODBC connection. However, there's one nuisance that should be somehow solved: the Access regularly asks for the user password

Pivot on multiple fields and export from Access

拟墨画扇 提交于 2019-12-28 04:34:20
问题 I have built an access application for a manufacturing plant and have provided them with a report that lists different data points along a process. I have a way to generate a report that looks like the following. Batch Zone Value1 Value 2 etc. 25 1 5 15 25 2 12 31 26 1 6 14 26 2 10 32 However, there is demand to view the data in a different format. They would like one line per batch, with all data horizontal. Like this... Zone 1 Zone 2 Batch Value1 Value2 Value1 Value2 25 5 15 12 31 26 6 14

How to loop through all controls in a form, including controls in a subform - Access 2007

老子叫甜甜 提交于 2019-12-28 04:14:24
问题 As the title of my question suggest, how is it possible to loop through all the controls in a form, including subforms. For example I use the below sub routine to set the background colour of controls with the tag * Public Sub colCtrlReq(frm As Form) ' Sets background color for required field -> Tag = * Dim setColour As String setColour = RGB(255, 244, 164) Dim ctl As Control For Each ctl In frm.Controls If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType =