access-vba

How do I pass a parameter into an access report programmatically?

假如想象 提交于 2019-12-17 12:16:32
问题 I've got an existing Access MDB. I'm adding a command button to an existing Form that runs an existing report. The change being made is that this button needs to pass in a parameter containing the ID of the record being reported on - currently the report runs on every record in the MDB. I've altered the Query that the report runs on to use a parameter for the ID value, so that now when the button is clicked Access prompts for the record ID to report on, and the report displays like it should.

How do I pass a parameter into an access report programmatically?

风格不统一 提交于 2019-12-17 12:16:12
问题 I've got an existing Access MDB. I'm adding a command button to an existing Form that runs an existing report. The change being made is that this button needs to pass in a parameter containing the ID of the record being reported on - currently the report runs on every record in the MDB. I've altered the Query that the report runs on to use a parameter for the ID value, so that now when the button is clicked Access prompts for the record ID to report on, and the report displays like it should.

Create sequential ID value based on the year that a record is added

不羁岁月 提交于 2019-12-17 06:57:26
问题 I am working on an Access 2013 database that will have different utility poles entered into the database and linked with other attributes. Each pole will have a unique global ID, and to simplify working I would like to add another unique ID that is more simple. I would like this field auto populated when a new pole in imported into the database. The ID would go as follows: SAC(year)-(Escalating number, cannot be a duplicate) ex. SAC16-20 (This would be the 20th pole entered into the database

How to increase performance for bulk INSERTs to ODBC linked tables in Access?

我们两清 提交于 2019-12-17 05:12:32
问题 I have CSV and TXT files to import. I am importing the files into Access and then inserting the records into a linked Oracle table. Each file has around 3 million rows and the process is taking a long time to complete. Importing into Access is very fast, but inserting into the linked Oracle table is taking an extremely long time. Here is the process I am currently using: DoCmd.TransferText acImportFixed, "BUSSEP2014 Link Specification", "tblTempSmartSSP", strFName, False db.Execute "INSERT

MS-Access, VBA and error handling

萝らか妹 提交于 2019-12-17 05:05:09
问题 This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and where the line number can be displayed when an error occurs. Did you find a solution? What is it? I just realized how many hundreds of hours I spared since I found the right answer to this basic problem a few years ago, and I'd like to see what are your ideas and solutions on this very important issue. 回答1: What about

MS-Access, VBA and error handling

℡╲_俬逩灬. 提交于 2019-12-17 05:05:08
问题 This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and where the line number can be displayed when an error occurs. Did you find a solution? What is it? I just realized how many hundreds of hours I spared since I found the right answer to this basic problem a few years ago, and I'd like to see what are your ideas and solutions on this very important issue. 回答1: What about

Combine rows / concatenate rows

倖福魔咒の 提交于 2019-12-16 20:04:21
问题 I'm looking for an Access 2007 equivalent to SQL Server's COALESCE function. In SQL Server you could do something like: Person John Steve Richard SQL DECLARE @PersonList nvarchar(1024) SELECT @PersonList = COALESCE(@PersonList + ',','') + Person FROM PersonTable PRINT @PersonList Which produces: John, Steve, Richard I want to do the same but in Access 2007. Does anyone know how to combine rows like this in Access 2007? 回答1: Here is a sample User Defined Function (UDF) and possible usage.

I want to set a value of a a new record form field in event procedure

不打扰是莪最后的温柔 提交于 2019-12-14 04:22:27
问题 I want a command button to open a new record of a form with one of its fields to have a value of a combo box from another form. Inventory is the form name while PRODUCT_CODE is a field name in the form Combo_Product_number is a combobox name of another form. So I want the form to openwith a product_code value field to have been filled with the value of the combobox. while the rest of the fields are empty. I am pretty new to access Private Sub Command5_Click() Dim stDocName As String Dim

How to set column values in a record set in access vba

好久不见. 提交于 2019-12-14 04:12:57
问题 Given below is the working code. Previously I was using the .Name property that didn't work. Previous code: For Each s In rs.Fields word = Replace(strArray(count), """", "") count = count + 1 'the below line shows error s.Name = word Next New Complete working code. It opens a dialog for user to select the .csv file and then imports all the data into the table from that csv file. strMsg = "Select the file from which you want to import data" mypath = GetPath(strMsg, True) mypath = mypath Dim

Select SQL Query using input from form fields Access 2007

牧云@^-^@ 提交于 2019-12-14 03:57:49
问题 I have a form with two combo boxes and a button that runs a select query with the code below. Currently the issue is it doesn't take the input of the combo boxes as the field input. Is this something that can be solved in SQL or would I have to build a form using VBA? SELECT Field=[Forms]![TestInteractForm]![Combo18], Field=[Forms]![TestInteractForm]![Combo20] FROM TestInteract; 回答1: Although it may not be apparent, your goal is basically the same as using a query parameter in the SELECT