Search results

  1. M

    Solved VBA access to outlook email with table: aligning table cells

    Hi! I am pulling some data from Access to send as table (table without borders). Private Sub Command71_Click() Dim strQry As String Dim aHead(1 To 2) As String Dim aRow(1 To 2) As String Dim aBody() As String Dim lCnt As Long Dim rst Dim strEmailto As String...
  2. M

    Solved Saving Query to Excel and Naming Worksheet

    I'm trying to save a query to excel, which I am able to do just fine. I'd like to assign a new tab (worksheet) to the excel sheet. Got that as well. Where I'm struggling is trying to NAME the excel tab/worksheet the name of a field on the form I am running the code on. So if in my form the...
  3. M

    Create VBA for opening and replacing range of cells in Excel Worksheet

    So I am taking data from a query "CHL" and pasting it into an Excel file. I got that to work fine. I would also like to then in Column I - remove the wording "CHL" from any cells in that range. (my code in bold below) I'm very new with VBA, so I'm sure I'm missing something obvious... but I...
  4. M

    Formatting text in field as upper AND lower as typed

    I have a standard text field in a form. When I type the text, it automatically converts it to ProperCase. (I.e., JRoss becomes Jross.) I know how to format to all upper or lower case, however, I can't for the life of me figure out how to have it read exactly as typed! Thoughts? Michele
  5. M

    Some database functions not working depending on which computer

    Why would some command buttons work on my computer, but not on another on a shared network drive? Command button to open report (written in VBA), and the "Not On List" function works fine on mine, but not on my colleagues. We had IT re-install Office Suite on her computer and still no change...
  6. M

    Updating a field in parent form from sub-form

    I am trying to update the background color of a field in my sub-form's parent form. ------------- Private Sub Combo23_AfterUpdate() If Me![Status] = "Pending: Waiting for Authorization" Then Me.Parent.OverallStatus.BackColor = QBColor(6) End If End Sub ---------------- It works by...
  7. M

    Sequentially numbering records in a query

    I can't seem to find an answer to this, if there is one. I am trying to assign a sequential number to each output query row. i.e., ID Name 5 Bob 8 Tom 3 Joe I want: ID Name 1 5 Bob 2 8 Tom 3 3 Joe Has anyone found a way to do this...
  8. M

    Extracting data between two commas

    I've used left and mid strings before, but someone can't get a handle on this one! DOE, JANE, MD I'm trying to just get the first name (Jane) (the text between the two commas). Any help would be appreciated! :banghead:
  9. M

    How to bypass VBA error message

    I have a code which on pressing command button, it opens email and attaches a file from my computer. If it does not find the file, I get a halt error, "cannot find this file". Is there a way to build into the code to continue to sending the email even if the file is not found/attached...
  10. M

    Basic VBA to open report based on field

    I thought this would be a very basic VBA code. I'm trying to open a report, using a command button, based on a mutual field in the report and on the open form [positionID]. While it does open the report, it is not limiting the report to that specific [positionID]. ---------------------...
  11. M

    Attaching TWO reports into email

    I've probably exceeded my questions for the week, and maybe my brain is just fried (thank goodness its Friday!).... I have the attached code which sends an email from my database via Outlook. Where/how do I go about attaching two reports from my database to the email as pdf files? -------...
  12. M

    Unbound field in form

    I have created an unbound field in my form. It is to update to a date when a macro runs. It works great, but when I exit the form, the date disappears! :banghead:
  13. M

    Open Form with no existing record

    I am trying to create a command button to open another form, "CoMorbidities" with mutual MRN#. If the MRN# does not already exist in the "Comorbidities" form, I need to add the MRN# to that form/table based on the same MRN# that is on the open form where the command button is. (Me.MRN#)...
  14. M

    AfterUpdate not working with auto-populated field

    I have a field [HiringMgr] which is auto-populated based on another field. This field is also a drop down field for cases when it doesn’t auto-populate. [HiringMgr] field also has an after-update command to do something else. This command does not “happen” when the field is auto-populated...
  15. M

    Email to include Outlook signature

    I have a code to send an email through Outlook looking up emails from a table. Is there a way to include my Outlook signature? ----------- Private Sub Command272_Click() Dim strFileName As String Dim rst As DAO.Recordset Dim strEMailTo As String Set appOutLook =...
  16. M

    Pulling emails into VB code from table

    Hi! I have a command button built with code to send an email, as such: ----------------- Private Sub Command271_Click() DoCmd.SendObject , "", "", ";", "", "", "New Hire Offer Made", "Good afternoon," & vbCrLf & vbCrLf & "Attached please find the CV for a...
  17. M

    Changing the font of a field in a form based on another form

    If my form field [urgency] is "time critical", AND my calculated Text53 field calculates >24, I would like to turn the font red. How off am I? :rolleyes: Private Sub Text53_AfterUpdate() If Me.Urgency = "Time Critical (<24h)" And Me.Text53 > 24 Then Me.Text53.ForeColor = vbRed End If...
  18. M

    Field being enabled based on checkbox

    I'm trying to code so that a textbox field is only enabled IF a certain checkbox is checked. Using this code: Private Sub checkbox_AfterUpdate() If Me.[checkbox] = True Then Me.[textbox].Enabled = True Else Me.[textbox].Enabled = False End If End Sub When I click the checkbox - I get...
  19. M

    Sub-forms expand based on records

    I have a sub-form which I'd like to "expand" based on the number of records. I know grow/shrink is not used for something like this. I'm not a proficient coder, but I tried this: Me.frm_subAssetEdit.Height = Me.Section(0).Height I put this code in the On Resize property in the sub-form, but...
  20. M

    Count of records between 2 date fields

    I'm wondering if it is possible to create a query off of a table as such: Table fields: PatientID StartDate EndDate How do I create a query that will yield the number of PatientID's for all dates in between Startdate and EndDate for ALL dates, say in 2017. (I.e, I want to know the # of...
Top Bottom