Search results

  1. 5

    Prevent date field from changing format on data entry

    I have a date and time fields which displays what I want it to display. I've also set up an input mask for users to enter what I need them to enter. It looks like: However, when I try to edit the field it changes the format. When clicking on date field: When clicking on time field: How do...
  2. 5

    How do I normalize my tables correctly?

    Hello everyone, I'm struggling to understand how to normalize my tables. Please see attached screenshot below. Problem is my tblCause table has CauseID and Cause fields. However, certain causes might have a sub-cause which I'd like to add or remove to. How do I go about this? Edit: What I...
  3. 5

    Solved Run-time error '3027' Cannot update. Database or object are read only.

    Good day everyone, I have the following error: Run-time error '3027' Cannot update. Database or object are read only. when using a certain form. On "Debug" it stops on following line of code: (Me.Dirty = False) Private Sub findWI() With Me.RecordsetClone If Not IsNull(lstWI.Value)...
  4. 5

    Solved Run-Time Error '3075'

    I'm getting following error: Line of code: strLastAudit = Nz(DMax("fldDateClosed", "tblIQA", "fldDocID = " & fldDocID)) I've also tried the following: strLastAudit = Nz(DMax("fldDateClosed", "tblIQA", "fldDocID = '" & fldDocID & "'")) fldDocID is a PK in tblIQA, an auto number. Any ideas?
  5. 5

    Split database accde file can't open by more than one user

    Hello! I have a database which I manually split. It contains no tables. Portal.accdb Next, I have a back-end file with all tables Portal_be.accdb Obviously tables are linked, everything works fine when using the application. These files are hosted on a server file folder. Next, I took...
  6. 5

    ComboBox selection to perform an action

    Hello everyone! I'm having some problems with my combo box selection. I need to select an item from drop-down combo box and depending on the selection perform an action. In this example, a simple message box with yes or no. Private Sub cboReview_AfterUpdate() DoCmd.Save...
  7. 5

    Error 2465

    I get the run time error 2465 with this code: docxFile = Me.fldFolder & "\" & Left([WordDocs.Name], 25) WordDocs.Name is a filename with .docx extension I'm guessing i've got syntax wrong? Anyone know how to fix it?
  8. 5

    OpenForm "Where condition" contains hyphen

    I'm having issues figuring out how to fix this bit of code: Private Sub fldSerial_Click() DoCmd.OpenForm "frmDocRevDetail", , , "[fldSerial]=" & MaxOffldSerial End Sub MaxOffldSerial contains a hyphen. It looks something like this: DR-22-001. When I click on the field, it opens the...
  9. 5

    Need to check if date returned falls on selected month

    Hi all, This is my continuation of previous thread. I figured this could be it's own thread since it's a follow-up question. I would like to use date value returned in my code and check if the month of that date is also present in another recordset which I use to activate/deactivate certain...
  10. 5

    Solved How do I set next due inspection one year out but with max number of inspections per month?

    Hello all, I want VBA to calculate field next due inspection one year out, but if it lands on a month which already has 3 inspections then I want it to go to next available month short of a year. (Example: if one year out = May which is all booked up, then I want it to check April, and so on...
  11. 5

    Button only adds a new record if another record exists

    Like the title says, when I try to add a new record to my subform via a button, it doesn't work UNLESS I manually enter some information in the first field then save it. My button has the following code: Private Sub btnSave_Click() With CurrentDb.OpenRecordset("tblObservation") If...
  12. 5

    Solved docmd.openform Where condition not working

    Hi all, I just don't understand why it's not working... Private Sub fldIQAID_DblClick(Cancel As Integer) DoCmd.OpenForm "frmIQA", , , "fldIQAID = " & Me.fldIQAID MsgBox "Your ID is " & fldIQAID & "" End Sub Few details: MsgBox shows that the ID it pulls is correct, but the form opens...
  13. 5

    Designing a code to assign date based on condition from another table

    Hello all! With the code below, I have RsHPOD!fldIQA = RsHPOD!LastAudit + 365. What I want it to be is as follows: I want = RsHPOD!LastAudit + 365, ONLY IF the month of result matched ONE OF MONTHS in another table which contains list of dates as date "fldMonth" and checkbox field...
  14. 5

    Button makes two records instead of one on click

    I've got two forms, one is for list of users "frmMembers" and another to get new users via outlook application code "frmNewMember". Once I click on "OK" button "cmdOk" it runs the following code: Private Sub cmdOk_Click() Dim Fail As Boolean: Fail = False ' Check to ensure the...
  15. 5

    Solved Download a file and store in a folder on click

    Hello all, I have decided to make a dedicated post since I had this as a part of another thread Here. Basically I need to click on a button and download a file based on URL from a txt box, and place it in folder based on fields. Here is what I have so far: Dim objHTTP As Object Dim...
  16. 5

    Solved Need to rename a file after copy to another folder

    Hello all So far I have this code: Private Sub btnGenerate_Click() Const strParent = "M:\429 QMO\Document Reviews\Document Reviews\" Dim strSerial As String Dim strSFolder As String Dim strFolder As String Dim fso As Object Dim FDate As String Dim Path As String...
  17. 5

    Solved DoCmd.OpenForm with where condition does not filter as expected.

    Private Sub btnNewDR_Click() DoCmd.OpenForm "frmdocrevdetail", , , "fldDocID =" & me.fldDocID, acFormAdd End Sub My main form is "frmWIDetail" In it, I have a sub-form "frmDocReview" Also on the main form I have a button "btnNewDR" My plan is to keep a record of reviews (Sub-form...
  18. 5

    Trying to filter date with textbox input

    Can someone explain why this doesn't work? Private Sub btnFilterDate_Click() Dim DueDate As Date DueDate = DateAdd("d", Me.tbxFilter.Value, Now()) Me.Filter = "ReviewDue <= duedate" Me.FilterOn = True End Sub I want to filter ReviewDue by today + what ever number is in tbxfilter.
  19. 5

    Set textbox to be a multiple criteria calculated field, for current recordset.

    Good day everyone I have a textbox "fldDocReviewDate" First variable is subform "subfrmWIAudit" field "fldAuditTypeID" Second variable is subform "subfrmWIAudit" field "fldAuditDate" Third variable is +365 days I want my textbox "fldDocReviewDate" to do this: 1. Locate the latest record in...
  20. 5

    Solved My code inserts two identical records instead of one

    When I click on OK button, it's supposed to add a record in my table based on the text boxes typed. It works, but it makes two entries instead of just one. Here's the code: Private Sub cmdOk_Click() Dim Fail As Boolean: Fail = False ' Check to ensure the pertinate data has been...
Top Bottom