Search results

  1. M

    Pulling emails into VB code from table

    This worked wonderfully: Dim strFileName As String Dim rst As DAO.Recordset Dim strEMailTo As String Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem) Set rst = CurrentDb.OpenRecordset("select ContactEmail from Contacts where...
  2. M

    Pulling emails into VB code from table

    You are amazing! My only problem, is that in the email body - I want to reference (pull in data) on a couple of fields. It no longer allows that ... ------------- Private Sub Command312_Click() Dim strFileName As String Dim rst As DAO.Recordset Dim strEMailTo As String Set appOutLook =...
  3. 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 , "", "", "testemail@here.org;test2@here.org", "", "", "New Hire Offer Made", "Good afternoon," & vbCrLf & vbCrLf & "Attached please find the CV for a...
  4. 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...
  5. M

    Field being enabled based on checkbox

    Problem solved. Apparently the default for the checkbox field was at YES. The default needs to be NO.
  6. M

    Field being enabled based on checkbox

    Yes, was using dummy names for ease of understanding. Maybe my field names are, in fact, the error? "Study10-055" is the field name for the yes/no checkbox. "StudyID_10055" is the name of the text field (for the study ID). Private Sub Study10_055_AfterUpdate() If Me.[study10-055] = True Then...
  7. 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...
  8. 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...
  9. M

    Count of records between 2 date fields

    Wonderful! Thank you Plog! I was on the right track creating the separate dates table, but needed the extra help to finalize. Also had to modify for dates not yet discharged to be counted. Really appreciate your help.
  10. 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...
  11. M

    Custom Editing an Error Message

    That's a new one to me! Thank you!! Great tip!:D
  12. M

    Custom Editing an Error Message

    I have a combo box that pulls Staff Names from a table. I have the limit to list as 'yes' (which I want). If Staff Name is not on the list I get an error, "The text you entered isn't an item in the list. Select an item from the list, or enter text that matches one of the listed items." I...
  13. M

    Counting records based on criteria

    Thank you both for your sound advice. I agree in this case I did it unconventionally. For this simple database, we are only tracking 3 cars per person. But you are right, there is room for error (and duplication) doing it this way. Thanks for reminding me that no matter how 'simple' a...
  14. M

    Counting records based on criteria

    I was trying to do a work-around. There are actually three fields [car1] [car2] [car3]. In the underlying query of the report, I created a field [car] which concatenates these three. I guess then my question would be how do I count records that would have Honda in either [car1] [car2] or...
  15. M

    Counting records based on criteria

    I have a report in which one of the fields is [cars]. The field could yield results such as: Honda Jeep Chevy, Jeep Honda, Jeep, Chevy In the footer, I'm trying to count how many where the word Honda shows up. =Count(IIf([car]='Honda',True,Null)) This gives me only 1. How can I do this...
  16. M

    Record Locking

    I do need them to share the front end or every time we make an edit to the form or add a tracking field or anything, I'll have to give an updated copy to each user.
  17. M

    Record Locking

    I did split the database. Back end of tables. Front end of forms etc. When the second person attempts to open the database it gives that error message - you click OK - and it gives you the error 10 more times. (ironically the number of tables?). It then lets you in and lets you edit.
  18. M

    Record Locking

    I just built a database that will be used by about 10 users. V 2016. When one person opens the database, it is fine. When a second person opens they get the error that they cannot open ("you do not have exclusive access to the database at this time"). Under client settings, I have default...
  19. M

    Carrying Over Field Value When Opening New Form

    Got it! Private Sub Command784_Click() On Error GoTo Err_Command784_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "PMD-ADD" stLinkCriteria = "[mr#]=" & Me![MR#] stDocName = "Visits Order" DoCmd.OpenForm stDocName, , , stLinkCriteria...
  20. M

    Carrying Over Field Value When Opening New Form

    As such? stLinkCriteria = Me.[Text787] or stLinkCriteria = Me.[MR#] The field on the MAIN FORM under properties lists name as Text787, with control source of MR#. I tried both and still not working. Am I completely confused? (Thank you for the field naming tip as...
Back
Top Bottom