ms-access

Access VBA DoCmd.TransferSpreadsheet runs too slow and causes Run-time error

徘徊边缘 提交于 2019-12-25 18:41:32
问题 I have a group of queries in a custom category in Access, and a bit of VBA code that gets the query names and runs them, and then copies the results for each query to a separate tab on an Excel spreadsheet. Here's the code: Private Sub Command0_Click() Dim oExcel As Object Dim oBook As Object Dim oSheet As Object Dim timestamp As String Dim path As String 'Create the Excel spreadsheet timestamp = Format(Now(), "yyyyMMddhhmmss") path = "C:\Users\username\Desktop\ValidationResults" & timestamp

Updating records but limiting to only one row per duplicate record

时光总嘲笑我的痴心妄想 提交于 2019-12-25 18:37:31
问题 I have a table with many item_number records which are duplicates within my table and the other columns within the table for each item_number are blank. All of the records within the table are under product group of g024. However when I run my query it will update all of my items numbers with this. What I want it to do is for each item_number only populate resource code, operation and operation description only once and not populating the remianing blank fields for each item_number with the

How to have data upload from access to sql server upon opening file

梦想的初衷 提交于 2019-12-25 18:26:24
问题 My form is housing the data I need it to, and I have gotten all the functions corrected. I am trying to figure out a way to get the data from the local access table to auto upload to a sql server db as long as there is an established connection, I was told record sets may be a good way to go. And I tried just linking the table but that is not what my boss is looking for. ANy ideas or direction would be greatly appreciated. The data housed is employee data, each time it uploads I just need it

Changing Row Colour according to condition

為{幸葍}努か 提交于 2019-12-25 18:24:15
问题 I am using MS Access for database Administration. I have seeveral linked tables producing different reports. I have already found a similar question on stackoverflow and did my reaserach on this issue. I am trying to paint rows according to conditions (Duration <20 Paint Beige, 2060 Red) I am using VBasic. This is my code. Please let me know what you think. Many thanks for your help! Sub ChangeBackType() Me.Date.BackStyle = 1 Me.Cell.BackStyle = 1 Me.Maintenance_Category.BackStyle = 1 Me

VBA Access export code module to folder

北城余情 提交于 2019-12-25 18:23:32
问题 I am trying to get Access VBA to copy one of its modules out to a folder - I have looked at the other threads / google and no joy - what do you think? Code below Sub copy_out_module() Set appAccess = New Access.Application Set dbsCurr = appAccess.CurrentProject Const ModulePath As String = "C:\Users\Sjohn\Documents\Components\" dbsCurr.Item("Module2").Export ModulePath End Sub 回答1: Your last line dbsCurr.Item("Module2").Export ModulePath can't run (Err. 438 Object can't admit property or

Update field in one table based on values in another table

☆樱花仙子☆ 提交于 2019-12-25 18:23:28
问题 I have a status field in a table in which test steps are marked as pass or fail and in another table I have to update test case(testID) as pass if all test step(testID) are pass , and fail test case if one of test is fail . I have testID field common in both tables. In the 1st table one column is testID and 5 steps are corresponding to that test ID and they can be pass or fail . In the 2nd table I have one column in which I have to mark status as pass or fail based on overall 5 steps. Table 1

INSERT data FROM sql query with one constant value in MS Access with SQL

不问归期 提交于 2019-12-25 18:18:31
问题 I am trying to create a form for MS Access where you at first search for companies in a table based on criteria. The returned data is simply the names of the matching companies. I then want to take these names and add them to a different table. So far there are 3 tables: one stores the User Names (tblStartup), one Stores the Company Names (tblVC) and one shall be used to save the matches (tblContact). The problem I have is that I want to add a constant user name alongside the data from the

Moving records from one table to another

风格不统一 提交于 2019-12-25 18:17:31
问题 I have a form that performs a search query on table A , which outputs the result on a subform on the same form. What I want to do is to add in a button that will move selected records on the subform into table B , deletes the records from table A (which I assume will be similar in principle to what I want to do below), then requeries the search, which I assume can be done with something as simple as me.requery . strID = Me.Form1_subform.Form.ID.Value strSQL = "INSERT INTO B ([a], [b], [c]) "

How to use combobox to open specific form in Ms Access

こ雲淡風輕ζ 提交于 2019-12-25 17:55:20
问题 How can we open specific form based on what we click in the combo box? I tried using macro but it only can be used for 1 value of the combo box only (cannot assign specific form for all value of combo box) 回答1: Goto to Combo box properties and select Macro builder Using Macro you can define all conditions and respective actions. 来源: https://stackoverflow.com/questions/51297019/how-to-use-combobox-to-open-specific-form-in-ms-access

How can a free tagging field be created in a Microsoft access form?

北城以北 提交于 2019-12-25 17:45:31
问题 Setup Access 2007 This is a simplified scenario. It is nearly identical to my actual use case just easier to explain. I have a many to many relationship between movies and genres the table structure is below. Table: movies id autonumber name text Table: genres id autonumber name text Table: movie_genres movie_id number genre_id number I would like a form that allows me to list all genre's for a given movie. But also allows me to create new genre's without opening a separate form. Similar to