access-vba

Is there a way to extract Picture OLEObjects from a table?

别来无恙 提交于 2019-12-25 03:13:47
问题 This is a follow up to this question: Is there a way to extract AutoCAD Drawings and Pictures from an OLE Object field So the question remains, how would I go about retrieving the images stored in a Picture OLEObject? If anyone has succeeded in this and could shed some light I would really appreciate it. As I said in my previous post I've searched extensively for this and even tried several times on my own but I can't seem to get anywhere. Thanks in advance, Rafael. Edit to include Image. The

Access VBA: how to dump OLE field content into bytes

拟墨画扇 提交于 2019-12-25 03:12:11
问题 I have a table containing OLE fields and I would like to see the content of some fields as bytes. I only can view it in the Watch window with BinData array so far . I tried to convert it to a byte array using CByte function but it gives an "Type mismatch" error. Is there any way to obtain the OLE field content as a byte array? My code which reads byte by byte field content into Bindata array: Sub DumpField() Dim BinData(100) As Variant Dim r As ADODB.Recordset Dim i As Integer Set r = New

What are all the fields available in a Notes email document in VBA

核能气质少年 提交于 2019-12-25 01:49:38
问题 I have written VBA code to send an email from a group mailbox. I set the principal field to say where the mail comes from. It almost works correctly, putting the message in the sent items of the group mailbox. Even though I have the group mailbox name in the Principal field, it still says it was sent my me. I discovered that whichever user looks at the message in sent items, it says it was sent by that user (it is a dynamic field). I want to set that From field, and I discovered I can do that

MS Access Find & Highlight Multiple Substrings that Match Any Table Column List Value in Long Text Field

好久不见. 提交于 2019-12-25 01:45:04
问题 I'm a beginner trying to figure out a strategy. Sample Data Table: Ingredients Field: FormulaIngredients Field Contents (Long Text Rich Text): rutabaga, leeks, carrots, wheat, flour, butter, sugar, eggs, milk, peanut butter, stone ground corn meal, whole grain oats, cabbage, turmeric, cloves, spice, natural beef flavor, ground beef. Table: RestrictedTable Column with 100 values to compare: RestrictedItem Example Column Values: milk bake spoon carrots mustard steam Desired Result : Want to

Rename a file with FileSystemObject while looping through files

断了今生、忘了曾经 提交于 2019-12-25 00:37:57
问题 As a preface, I'm writing code in Access 2003, but will have users using Access 2013, and so I need it to be compatible for both. I have a loop that uses the Application.FileSearch to loop through a number of files in a directory. It is my understanding that this is deprecated in newer version of Access, and so I have to use "For Each" to loop through files. Here's the piece of code I'm changing: strPath = CurrentProject.Path & "\Files\" strFileName = "SourceCode.txt" With Application

Access VBA - Identifying text

主宰稳场 提交于 2019-12-25 00:33:56
问题 Im trying to create a button to delete certain records in a subform. However im getting "syntax error (missing operator) in query expression 'KEY_ID="1'. I know what the problem is: The attribute is text therefore the value needs to be surrounded by single quotes. I just don't know how to write the VBA to accomplish this. Private Sub cmdDelete_Click() If Not (Me.subKey.Form.Recordset.EOF And Me.subKey.Form.Recordset.BOF) Then If MsgBox("Confirm Deletion?", vbYesNo) = vbYes Then Dim strSql As

How do you copy the entire record from one table to another including attachment filed?

被刻印的时光 ゝ 提交于 2019-12-25 00:33:52
问题 I have two tables, tb1 and tb2. I would like to copy the entire record from tab1 to tbl2. The tables contain attachment fields so INSERT statement is not suitable. My current approach uses DAO but its only copying the first record. Please see code: Private Sub InsertRecord_Click() Dim db As Database Dim rs1 As DAO.Recordset Dim rs2 As DAO.Recordset Dim rsAttachment1 As DAO.Recordset2 Dim rsAttachment2 As DAO.Recordset2 Set rs1 = CurrentDb.OpenRecordset("tbl1") Set rs2 = CurrentDb

How to add an editable column to non-editable query

扶醉桌前 提交于 2019-12-25 00:12:27
问题 I have a Query in Datasheet View in a Subform which holds information that the user needs to add to. Specifically, 2 columns need to be edited. The Query is non-editable because of a ton of GROUP BY clauses. Is there a way that I can add these 2 columns and make them editable per row without changing the query/rewriting it to make it editable? So far, I've tried adding an unbound column but that doesn't hold the data per row. Now, I've set a new table with the two columns I want to add as

Access 2007 Using the ID value from a list box in VBA/SQL statement

女生的网名这么多〃 提交于 2019-12-24 22:27:18
问题 Guys...if I want to run a button click event that takes a list box and uses the ID field that is in the listbox in a SQL statement in VB, then is it me.MyListbox.selected or me.MyListbox.value to get that value? for some reason I have tried both and neither seem to be working. .value returns an empty value, and .selected generates an error stating the argument is not valid. thanks justin 回答1: If the ID is the bound column and the listbox is not multiselect, you can use just the name of the

Parameterise a RecordSource query to ensure the data remains updateable?

此生再无相见时 提交于 2019-12-24 21:28:50
问题 I have a subform within a main form, that is set to datasheet view and extracts data from a SQL Server database, based on the forms supplied parameters. This means that selecting a different team from the combobox or date from the datepicker, pulls the relevant information into the datasheet. The user needs to be able to manipulate a boolean field within the data, and so far the only way I have found that I can make this data load and keep it updateable is to write the query in the