Search results

  1. A

    Filter a Report by month and year

    I'm having trouble getting my filter to work. I'm trying to get a report to filter the month and year from a date. I have fields for the month and the year on the report, x and y. I'm extracting the month and year from the date field in the form. I get a syntax erro on the code, and think...
  2. A

    Set a Subform Unbound Control controlsource from the Mainform

    I want to set an unbound control on a subform based on a value in an unbound combo box on the mainform. The mainform, frmRecallPayQuantities, has a combobox cmbMonth. The subform, frmDailyReportQuantitiesSummary, has an unbound textbox in the forms footer called txtMonth. I'm trying to use...
  3. A

    SQL problem WHERE clause from 2 tables

    I'm been struggling with this SQL statement for several days. I want to insert values from 2 tables into another. I get a missing operator error on the WHERE statement Private Sub cmdInsertDefaultReviewers_Click() Dim strSQL, strCN As String 'SQL statement. Dim lngID As Long...
  4. A

    GetOpenFileName(OpenFile) not working

    I have code to add hyperlinks for files to a text field on a form. The code has worked for years, but suddenly stopped working on one users computer. The code uses GetOpenFileName(OpenFile) to open a directory to get the link to the document. The machine in question is running Windows...
  5. A

    ms access run time error 3046 could not save; currently locked by another user

    I have the following code to add a record to a table after a change to a record on a form; Private Sub Note_BeforeUpdate(Cancel As Integer) Dim tblSubmittalLog As DAO.Recordset Dim ddd As Date Dim strWhat As String ddd = Date If Me.NewRecord Then strWhat = "Added: "...
  6. A

    Function issue

    I've created a function that takes 2 dates and then should find the number of holidays between the 2 dates; the holidays are listed in a table. Function Holidays(StartDate As Date, EndDate As Date) As Integer Holidays = DCount("*", "tblHolidays", "([HolidayDate] <= EndDate ) AND...
  7. A

    VBA to move to a new record in a subform

    I have code in my form to print preview a report. I would like to move to a new record in a subform after the report is opened. I have tried to enter this code at the end of the open report code: Me.frmToDoListEntryLinks.SetFocus DoCmd.GoToRecord , , acNewRec I get a Run-time error...
  8. A

    Form Filter with like

    I'm trying to filter a subform based on a value on the main form. I'm filtering on 2 fields. One is Job. The for the second field, I want all the records that have the same characters prior to the 1st "R" in the string. Here is the code. If InStr(Me.ContractorNumber, "R") > 0 Then...
  9. A

    SQL issue

    I have a simple problem that has me stumped. I'm trying to add data to a table with an input into Sql string. I get a syntax error missing operator in the query expression '25r1'. 25r1 is the value of strCN. lngID is a number, the other items are strings. strSql = "INSERT INTO...
  10. A

    Retrieve Data from a Subform VBA

    I have a main for and a subform. Both forms have the e-mail addresses of people on them. On the main form, I have a procedure to e-mail a report to the person. I would like to add a procedure to also e-mail the people on the subform, if there are any. I think this would involve using...
  11. A

    Subform issue - not refreshing.

    I have a form with 3 subforms that are linked by the one key field. The subfroms are located on a tabControl I open the main from from another form with a where clause. Only one of the 3 subforms displays the related data. The others are empty. If I change the view of the form to...
  12. A

    Not in List Issue

    I'm not able to get this Not In List event to function on this form. The event opens another form to add the data to the table that supplies the values to the combo box. The data is entered into the table. However, the combo box does not immediately show the new value and I get the...
  13. A

    Export Long Text from Access to Word

    I have code that will export data on an Access form to a Word template with text box fields. All data exports fine, except a long text field. The Word text box remains blank. The Word text box is "txtPDescription" and the Access field is "ProjectDescription". I've tried a number of...
  14. A

    Not in List on subform

    Having trouble with this issue. I'm using code borrowed from somewhere else. I want the code to be independent of the from I am originating the event from. The original code was driven by an event on a main form. My issue is how to get the code to recognize the name of the subform. I...
  15. A

    Duplicate Record in Form and Subform with 2 where clause

    I am trying to duplicate a record on a form and change one field based on a user input. I have based the code on this from Allen Browne: http://allenbrowne.com/ser-57.html I am having trouble with the where clause in the SQL. I am not very familiar with SQL. I get a Error Syntax error...
  16. A

    Generate a value in subform on change

    I would like to enter a record in a table if a value of a control changes on a form. I would also like to enter record in the same table if the record is new with a differing value in one of the fields. I can code the first part, but have not been able to figure out a way to get the 2nd...
  17. A

    Trouble Sending Report

    I can't get this code to send the report. The code creates the report, but does not get past the send command. It never gets to the close report line. If I modify the code to send a different report, it works fine. Private Sub cmdOrgPrint_Click() Dim LResponse As Integer Dim hours As...
  18. A

    Unbound Combo Box issue

    I have 2 unbound combo boxes on a form. cmbJob cmbWho The after update event for cmbJob requeries cmbWho (as well as a subform). All this works fine. Here's the problem If I try to add another column to cmbWho, the row source no longer recognizes the cmbJob Criteria. I've attached 2...
  19. A

    Hyperlink edited by code

    I am trying to modify a hyperlink based on user input from a form. I want to add a date from a text box to the end of a url. Here is the code: Private Sub Weather_DblClick(Cancel As Integer) Dim strLink As String Dim strDate As String strDate = Format(Me.DateOfReport, "yyyy-mm-dd")...
  20. A

    Not in List - Function to use on multiple forms

    I would like to use a function for my not in list. I use the combo box on may forms, and would like simplify things by using a function. Here is the code I've tried. It works as a subroutine, but when trying it as a function I am not sure how to transfer the NewData and Response: Public...
Top Bottom