ms-access

How to get file path of the file with the running-vba code

痞子三分冷 提交于 2019-12-24 19:35:13
问题 I want to get the folder path from the file who is running the vba-code. For example: the vba-code is in the file C:\myfolder\file.accdb and I want the vba-code to return C:\myfolder\ Is that possible? 回答1: You need currentproject.Path 来源: https://stackoverflow.com/questions/1729752/how-to-get-file-path-of-the-file-with-the-running-vba-code

Access - Merge two databases with identical structure

时光怂恿深爱的人放手 提交于 2019-12-24 19:33:00
问题 I would like to write a query that merges two Access 2000 databases into one. Each has 35 tables with identical fields and mostly unique data. There are some rows which will have the same "primary key" in which case the row from database A should always take precedence over database B. I use quotes around "primary key" because the databases are generated without any keys or relationships. For example: Database A, table1 col1 col2 Frank red Debbie blue Database B, table1 col1 col2 Harry orange

How to regularly update MS Access table from linked .txt file?

与世无争的帅哥 提交于 2019-12-24 19:24:06
问题 While I think I may be able to work out a hack job solution solution, I'm hoping to identify the most simple way to regularly update a MS Access table to exactly match the contents of a linked .TXT file. I want MS Access to change values in a row in the table if the values in the same row in the linked .TXT file have changed, as well as add any new rows and delete any rows that are no longer in the .TXT file. I presently have an append query to add the new rows. Is it possible to do all of

Access Code - mantantory fields in a form

。_饼干妹妹 提交于 2019-12-24 19:18:36
问题 I am using the following vba code in my form. Private Sub imgCustomer_Click() On Error GoTo Err_Handler DoCmd.Close acForm, "frmCustomer", acSaveYes DoCmd.OpenForm "frmSplashScreen" Exit_This_Sub: Exit Sub Err_Handler: MsgBox "Error #: " & Err.Number & " " & Err.Description Resume Exit_This_Sub End Sub My problem is that the form contains textbox which must not left empty. If for example Surname and Name fields must have a value and the user only fill the Surname and press the imgCustomer

SQL Query From Two Tables And Several Rows

China☆狼群 提交于 2019-12-24 19:14:55
问题 I have 2 tables. The fisrt: Users The second: Messages My tables relationships: My problem is: I need a query that returns me the all the Messages for reciver (the parameter) and the MessageSenderID and MessageReciverID as name, not as id. my query: SELECT Message.MessageID, Message.MessageSubject, Message.MessageContent, u1.UserFisrtName + '' + u1.UserLastName AS Sender1, u2.UserFisrtName + '' + u2.UserLastName AS Reciver1 FROM Users AS u1, Users AS u2, Messages WHERE u1.UserID = Message

Dependent Combobox in a Datasheet in Access?

梦想与她 提交于 2019-12-24 19:14:44
问题 I've created a dependent combobox as mentioned as this article. http://office.microsoft.com/en-au/access-help/basing-one-combo-box-on-another-HA001173058.aspx However, the problem I'm having is that I'm trying to do this with a datasheet. When I specify the criteria as another field, it'll look at the first row's value instead of the current row's value. I'm willing to do this as a contiguous form as well, but don't know if that would help. 回答1: Unbound controls in a continuous form will only

Multiline property problems

狂风中的少年 提交于 2019-12-24 19:13:28
问题 I have a column in my database that is set to memo. I am trying to view the data in a textbox. I have enabled new line in field from the Enter Key Behaviour property but all the data from the record is now showing - What am I missing? The data is being pulled from a list box, example code below: Textbox1 = listbox.column(1) Thanks in advance 回答1: This has nothing to do with the EnterKeyBehavior property of the text box. http://allenbrowne.com/ser-63.html Row Source A Memo field in the Row

Can Access read the contents of an Excel file without importing it to a table?

旧街凉风 提交于 2019-12-24 19:08:06
问题 Is it possible to read the header row of an Excel workbook to determine if certain fields exist before importing to a table? I would like there to be a notification if those certain fields are missing before the import happens. My Access database requires users to import data from Excel files that are generated by a different system where users can choose the fields to export. Sometimes users accidentally fail to select certain fields that are required for my database to work, which causes

How can I insert a set of records in an Access table which come from an aggregate query

别等时光非礼了梦想. 提交于 2019-12-24 18:55:28
问题 MS Office 365 ProPlus, Access 2007 - 2016 I'm trying to insert a set of records into a table using an insert statement feeding out of a select statement. Here is what I'm trying... insert into BurnDownMetrics (day,project,domain,tot_effort_spent,tot_effort_left,tot_est_effort) SELECT Date() AS Expr1, ardmerspk.project, ardmerspk.domain, Sum(ardmerspk.effort_spent) AS SumOfeffort_spent, Sum(ardmerspk.effort_left) AS SumOfeffort_left, Sum(ardmerspk.tot_effort) AS SumOftot_effort FROM ardmerspk

Microsoft Access cannot add records join key of table not in recordset

↘锁芯ラ 提交于 2019-12-24 18:54:33
问题 I know this is a repost, I have done my research on everything possible and I couldn't find anything to assist nor help me with my current problem. No matter how many times I re-create my Query or Form, I just can't seem to get it to work correctly. if I run my Query, I will get the correct information displayed, but when it comes to adding information through a custom form I made, I get this error -> "cannot add records join key of table not in recordset" . My current Query, incase you