Search results

  1. 5

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

    Function GetNextDate() As Date Dim nxtInspection As Date strHP = "SELECT [Work Instructions].*, tblWIUnion.* FROM [Work Instructions] INNER JOIN tblWIUnion ON [Work Instructions].ID = tblWIUnion.fldWIID " & _ "WHERE ((([Work Instructions].PA)='High')) OR...
  2. 5

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

    Did you mean something like this?: My function returns a correct date, but RsHP!fldIQA = GetNextDate only comes up with 12:00:00 instead of returning a date. Any ideas?
  3. 5

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

    Interesting... In the following line: Do Until DCount("1", [tblInspection], "Format$([next inspection date],'yyyymm')='" & Format$(nxtInspection, "yyyymm") & "'") < 3 , why do you have "1" where DCount string should go instead of field name? Here's my code so far: Function MakeSched() On Error...
  4. 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...
  5. 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...
  6. 5

    Solved docmd.openform Where condition not working

    Ok, it works if I specifically set recordsource to table only "tblIQA". If I try to set it to a query then it breaks everything. Here's the query in question: SELECT tblIQA.*, tblObservation.*, [tblMember]![fldLastName] & ", " & [tblMember]![fldFirstName] AS Auditor...
  7. 5

    Solved docmd.openform Where condition not working

    Not sure if this is relevant, but: I had to change my form "frmIQA" from Dynaset to Dynaset (Inconsistent Updates) because it was loading blank for some reason.
  8. 5

    Solved docmd.openform Where condition not working

    It's set to = No
  9. 5

    Solved docmd.openform Where condition not working

    Yes, I see what you mean with msgbox test. fldIQAID is an AutoNumber. Unfortunately that didn't work.
  10. 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...
  11. 5

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

    Hi, I've uploaded a sample DB. [Work Instructions]!PA determines whether it's HIGH or LOW priority. Both HIGH and LOW priority are assigned to first available month, HIGH is on one year cycle, LOW is on four year cycle. I want to keep max at 4. If there are more then I want LOW priority...
  12. 5

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

    Good point. So yes, trying to conduct audits based on selected months where high priority is conducted every one year and low priority every four years. If the due date falls on the month it's not selected then I just want to assign it next first selected month. Hope that clears it up a bit.
  13. 5

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

    Hi! Here is a sample of DB. frmIQASched is the main form. When I press "Generate" button, I want the following value in "fldIQA" field: Date based on "LastAudit" + 1year (if the PA = "High" and fldPriChange = True) or Date based on "LastAudit" + 4 years (if the PA = "Low" and fldPriChange =...
  14. 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...
  15. 5

    Button makes two records instead of one on click

    Ok, it looks like first part of code was the problem: Dim Fail As Boolean: Fail = False ' Check to ensure the pertinate data has been intput If Not Len(txtLast.Value) > 0 Then txtLast.BackColor = RGB(255, 0, 0) Fail = True Else...
  16. 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...
  17. 5

    Solved Download a file and store in a folder on click

    That's right! I've dug around and I've noticed that in original code. Not sure how I messed it up. Second, on my Open strFolder & strSerial & "\" & strFile For Binary Lock Read Write As #intFile line, "strFolder" was supposed to be "strSFolder". It all works now. Thanks! By the way, the...
  18. 5

    Solved Download a file and store in a folder on click

    I get "Type Mismatch" on following line: intFile = Forms!frmWIDetail!txtDoc.Value()
  19. 5

    Solved Download a file and store in a folder on click

    Ok, will consider that next time, my apologies. strSFolder = strParent & FDate & "\" strSerial = Me.fldSerial FDate = Format(Now, "yyyy") Const strParent = "M:\429 QMO\Document Reviews\Document Reviews\" Those are in the code above.
  20. 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...
Back
Top Bottom