Search results

  1. R

    OpenForm command where clause with 2 criteria

    Where is the error? If it's at the end of statement, it's because I copied over the end quotation mark by mistake.:rolleyes: If it's something else, please provide details.
  2. R

    OpenForm command where clause with 2 criteria

    Try this: DoCmd.OpenForm "frmadditionalcomments", acNormal, , "Eval_Number=" & Forms!ESVWL1Trainee!subfrmreponses.Eval_Number & " AND Question_Number= " & Forms!ESVWL1Trainee!subfrmreponses.Question_Number"
  3. R

    Creating Multiple Appointments from one form

    Glad to have helped :)
  4. R

    Open Multiple reports using For Loop

    The question then becomes "what is the value in txtHidden when you don't use the loop?" I don't understand what your DCount test is for. In effect, that is a constant within the loop as written (i.e. it is always true or always false during loop iteration). If the DoCmd is not executed in the...
  5. R

    Open Multiple reports using For Loop

    Try this: Dim rpt As Report For Each rpt In Access.Reports [Forms]![frmStartup]![txtHidden] = rpt.Name If DCount("*", "ReportQuery", "") > 0 Then DoCmd.OpenReport [Forms]![frmStartup]![txtHidden], acViewPreview End If NextIf I read your logic correctly, you don't really need...
  6. R

    Creating Multiple Appointments from one form

    Don't be afraid to make changes! But DO make a copy of your working code so you can restore if it all goes wrong. ;) Try this: For i = 1 To 3 Set ctl = Me.Controls(Choose(i, "DateTemplateMade", "DateofTopCut", "DateBowlCut")) Rem check value of current control If Not...
  7. R

    Creating Multiple Appointments from one form

    Progress! That's good. :) Have a look at the lineSet olappt = olapp.CreateItem(1) ' olAppointmentItem in relationship to the loop. What's happening is that the appointment item is created, then the loop updates it three times. You need to create each item inside the loop.
  8. R

    Matrix, array, loop in VBA ?

    Where did you put the module you created for my code? This is an Excel VBA module, to be put in the workbook of file names after export from Access. I don't see any obvious reason for the error you have. I note you use .xls as you Excel file extension - which version of Office to you have? My...
  9. R

    Record not showing correctly

    Glad to hear it's resolved :)
  10. R

    Creating Multiple Appointments from one form

    Please post your complete code as it is now. I suspect the value of ctl is not set correctly, but I can't say for sure. Do you know which iteration of the loop fails?
  11. R

    Creating Multiple Appointments from one form

    These two errors are to do with Object setting. I think it may be the names used in the Choose statement - I used the values you listed at the start of your post, but looking more closely at the code itself, I see you used Me.Date_Template_Madei.e. with underscores in place of the spaces. If...
  12. R

    Record not showing correctly

    what do you mean by the source DB? What is your RecordSource? How do you apply and remove the filter?
  13. R

    Before Update event

    Hmmm :confused: I just tried a quick test using a combo box with three values - 2012, 2013 & 2014. With this, I used the following:Private Sub cboYears_Enter() Rem save the current value intYears = Nz(Me.cboYears, 0) End Sub Private Sub cboYears_Exit(Cancel As Integer) Rem check for invalid...
  14. R

    date creation property vba

    DateCreated contains date and time, so it will not match with Date. A simple way to achieve the check is to take the integer part of DateCreated for the comparison, like this:If Int(CurrentDb.TableDefs("tFiles").Properties("DateCreated").Value) <> Date Then
  15. R

    ByVal ByRef

    Your understanding is essentially correct. I'm not sure if you think a ByVal parameter would be updated? (It wouldn't). Here's an example for you:Rem conditional compilation used to select the method below #Const kMode = flase Private Sub test() Rem the value to be changed Dim intTest As...
  16. R

    Before Update event

    Try this:Private Sub cboYears_BeforeUpdate(Cancel As Integer) Dim dteNewDate As Date dteNewDate = DateSerial(Val(Me.cboYears), Month(Me.txtCalendarHeading), 1) If Not fncIsDateInRange(fncFirstDayInMonth(dteCalStartDate), fncLastDayInMonth(dteCalEndDate), dteNewDate) Then MsgBox "Date not in...
  17. R

    docmd.maximize

    If I understand you correctly, it works in normal window mode, but not in pop-up mode? I didn't see the pop-up part in your original post - is that a requirement? If so, why? When it breaks, how does it break? Do you still have the problem with the window not rendering correctly? If so, is...
  18. R

    docmd.maximize

    Try this:Private Sub Report_Load() DoCmd.SelectObject acReport, Me.Name DoCmd.Maximize End Sub I used the Load event, rather than the Open event on one of my reports and it worked OK. You need the DoCmd.SelectObject to make the form the subject of DoCmd>Maximize.
  19. R

    Creating Multiple Appointments from one form

    You could do something like this:Dim i As Integer Dim ctl As Control For i = 1 To 3 Set ctl = Me.Controls(Choose(i, "[Date Template Made]", "[Date of Top Cut]", "[Date of Bowl Cut]")) Start = ctl With olappt ' If There is no Start Date or Time on the Form use Nz to avoid an error '...
  20. R

    None of my forms are opening, help!!!

    This might help: http://www.allenbrowne.com/ser-47.html
Back
Top Bottom