User Profile
Woldman
Iron Contributor
Joined 8 years ago
User Widgets
Recent Discussions
Re: Access and joining rows columns and fields
Hi Ttsz1 If I understand your request correctly, it would be quite complicated to achieve this and require some significant VBA programming with dynamic field arrays or a comparable solution. Therefore, I'm wondering if Excel could fulfill your request since a spreadsheet has the column/row structure you'll need and adding a person or doc only means adding a row or column. The intersecting cells for persons and docs then contain the yes/no values. Just a thought.248Views0likes0CommentsRe: Populate a field based off partial information in another field
Hi BrianC42 I've attached an example Access database that addresses your question. It contains a sample form with a barcode and type field. If you enter a barcode starting with an "A" the type field changes to "Radio" and likewise to "Battery" when you enter a barcode starting with a "B". The type field filling works with this little VBA code for the form: Private Sub txtBarcode_KeyUp(KeyCode As Integer, Shift As Integer) Select Case UCase(Mid(txtBarcode.Text, 1, 1)) Case "A" txtType.Value = "Radio" Case "B" txtType.Value = "Battery" Case Else txtType.Value = "" End Select End Sub It's just a simple implementation, but I hope this helps, Tieme309Views0likes0CommentsRe: Sample Access application for creating appointments in Outlook
I've also added functionality to delete an appointment from Outlook. In the sample application, you'll now find a delete button in addition to the add button. This is the underlying code, which deletes an appointment if the subject and start date/time match: Private Sub cmdDeleteFromOutlook_Click() Dim xOL As Outlook.Application, itmAppoint As Outlook.AppointmentItem, colAppoint As Outlook.Items Dim nmsOL As Outlook.NameSpace, fldOL As Outlook.MAPIFolder Dim i As Integer ' Create the actual Outlook object and an object for the appointment to be deleted Set xOL = New Outlook.Application Set itmAppoint = xOL.CreateItem(olAppointmentItem) Set nmsOL = xOL.GetNamespace("MAPI") Set fldOL = nmsOL.GetDefaultFolder(olFolderCalendar) ' Loop over all appointments Set colAppoint = fldOL.Items For i = colAppoint.Count To 1 Step -1 Set itmAppoint = colAppoint.Item(i) ' Delete appointment if description and start data/time match If Me.ActionDescription = itmAppoint.Subject And Format(Me.ActionDate, "yyyy-mm-dd") & " " & Format(Me.ActionTime, "hh:mm") = Format(itmAppoint.Start, "yyyy-mm-dd hh:mm") Then itmAppoint.Delete ' Reset the checkbox Me.AddedToOutlook = False ' Requery the form to show all data changes Me.Requery End If Next ' Remove the objects to keep memory clean Set itmAppoint = Nothing Set colAppoint = Nothing Set nmsOL = Nothing Set fldOL = Nothing Set xOL = Nothing End Sub This code also resets the 'Added to Outlook' flag in the Access database. I hope this helps. Tieme1.3KViews0likes0CommentsRe: Sample Access application for creating appointments in Outlook
Not at all. The following steps are a way to add it to an existing database: 1. Open the OutlookAppoint database. 2. If needed, expand the Shutter bar/Navigation pane. 3. Right-click the Actions form and select Export > Access. 4. Browse to and select the existing database where you want to add to. 5. Clik OK. 6. Open the existing database and optionally modify the (imported) Action Form.2.5KViews0likes0CommentsSample Access application for creating appointments in Outlook
Hello everyone, I received several requests for my sample Access application for creating appointments in Outlook, so I am sharing it here. The application The application automatically opens the Action form. When you complete this form and click Add to Outlook, some VBA code in the application creates an appointment in Outlook based on the action data and checks the Added to Outlook setting. The VBA code Select Database Tools > Visual Basic to open the underlying VBA code. If needed, expand the Project folder: And double click the Form_Actions object to display the VBA code: Private Sub cmdAddToOutlook_Click() ' Only add an appointment to Outlook if it has not been done before. If Me.AddedToOutlook = False Then ' Declare objects for the Outlook application and an appointment that you can address programmatically Dim xOL As Outlook.Application, itmAppoint As Outlook.AppointmentItem ' Create the actual Outlook object and an object for the appointment to be added Set xOL = New Outlook.Application Set itmAppoint = xOL.CreateItem(olAppointmentItem) ' Fill the appointment details and send it to Outlook With itmAppoint .Subject = Me.ActionDescription .Start = Me.ActionDate + Me.ActionTime .End = Me.ActionDate + Me.ActionTime + Me.ActionLength .Location = Me.ActionLocation .Save ' <- this actually sends the appointment to Outlook End With ' Remove the objects to keep memory clean Set itmAppoint = Nothing Set xOL = Nothing ' Set the checkbox Me.AddedToOutlook = True ' Requery the form to show all data changes Me.Requery End If End Sub Note I set a reference to the Outlook Object Library from VBA, but if you receive an error that the reference is missing, follow these steps from VBA: Select Tools > References... Scroll to the Microsoft Outlook 16.0 Object Library item and select its checkbox. Your version may be different from 16.0 when you work with another Access version. Click OK. Try to add to Outlook again.3KViews4likes11CommentsRe: Access - Template Contacts - "Search Not Picking Up words"
Hello Claire, At the bottom of the macro you can add a new action and select the SetTempVar -statement. After filling the statement-parameters for Project (as in the example) you can move it up with the green up-arrow. Alternatively, you can select the last SetTempVar-statement, right click on it and choose Copy. Next right click again and choose Paste. Now fill in this pasted-stament the reference to the Project field.1.3KViews0likes0CommentsRe: extract image from Ms Excel using Ms Access Vba
Marco_DellOca I use this in Excel (VBA). This subroutine exports pictures by first converting them to a chart object that can be saved to a folder. You can either use this in Excel or port it to Access VBA: Sub SaveAllPictures() Dim shPictures Set shPictures = ActiveWorkbook.Sheets(2) Dim oShape As Shape Dim strPictureName As String Dim oChartObject As ChartObject Dim oChart As Chart For Each oShape In ActiveSheet.Shapes strPictureName = oShape.Name oShape.Select Selection.ShapeRange.PictureFormat.Contrast = 0.5 Selection.ShapeRange.PictureFormat.Brightness = 0.5 Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic Selection.ShapeRange.PictureFormat.TransparentBackground = msoFalse Selection.ShapeRange.Fill.Visible = msoFalse Selection.ShapeRange.Line.Visible = msoFalse Selection.ShapeRange.Rotation = 0# Selection.ShapeRange.PictureFormat.CropLeft = 0# Selection.ShapeRange.PictureFormat.CropRight = 0# Selection.ShapeRange.PictureFormat.CropTop = 0# Selection.ShapeRange.PictureFormat.CropBottom = 0# Selection.ShapeRange.ScaleHeight 1#, msoTrue, msoScaleFromTopLeft Selection.ShapeRange.ScaleWidth 1#, msoTrue, msoScaleFromTopLeft Application.Selection.CopyPicture Set oChartObject = ActiveSheet.ChartObjects.Add(0, 0, oShape.Width, oShape.Height) Set oChart = oChartObject.Chart oChartObject.Activate With oChart .ChartArea.Select .Paste .Export ("..." & strPictureName & ".jpg") '<-- add your folder here End With oChartObject.Delete Next Set shPictures = Nothing End Sub Best regards, Tieme3.1KViews0likes4CommentsRe: Access - Template Contacts - "Search Not Picking Up words"
cf24_ Hello Claire, You need to add the following to the Search-macro, since you added the Project-field to the Contacts-table and the Contact List-form (Right click the Search-macro and select Design View to edit the macro) : After adding the statement to the macro and saving it, the Search-functionality in the Contact List-form also searches in the Project-field. Good luck. Best regards, Tieme1.3KViews1like2CommentsRe: create Appointment Item in MS Outlook Calendar from Button in MS Access
Julie1606 Hello Julie, I created an Access application for this, but I can not send Access files through this community. Do you have a regular mail address where I can send the Access file to? Maybe you can send the mail address to me in a direct message. Short explanation The application creates an Outlook-appointment on clicking the Add To Outlook button. Below an example of the form: After filling the form and clicking the button the appointment appears in Outlook: And if you open the appointment you see the details: I hope you can incorporate the VBA-code and form functionality of my application into your application. The VBA-code is in the module modAppointment. And in the form you need to connect the click-event of the button to the cmdAddToOutlook_Click subroutine in the VBA-form module (Form_Action). If this does not work out for you, maybe you could send me your application and I will incorporate the functionality. But that depends on the security policies of your organization. Good luck and feel free to contact me for any further questions. Best regards, Tieme7.4KViews1like6CommentsRe: MS Access - looking for help with some 'under the hood' coding.
Hello Gregory, I could think of a solution with the (VBA) timer-event of the pop-up form that checks if a scan occurred. I would set the timer to fire every x milliseconds and within (the VBA) Form_Timer subroutine I would execute the following 'actions': 1. Check with an If-statement if the asset # is filled (by the barcode scanner). 2. If asset # is filled, run a query with DoCmd.RunSQL to UPDATE the yes/no field and the Checkindate. 3 Empty the asset # field (with something like Me.txtAssetNo = ""); reset the tag-info if needed. This way the pop-up stays open, waiting for the next scan. And if that happens, the timer-event processes the next scan. No keyboard or mouse action needed. Hope this helps. Best regards, Tieme850Views0likes0CommentsRe: create Appointment Item in MS Outlook Calendar from Button in MS Access
Hello Julie, I have done this in Access with Visual Basic for Applications (VBA), but that probably exceeds your scope as you are pretty new to Access. Nevertheless, let me know if you would try to set this up with VBA. Best regards, Tieme7.7KViews1like9Comments
Recent Blog Articles
No content to show