Search results

  1. P

    VBA openform where clause

    im trying to run this: DoCmd.openForm formName, , , [Attendance Sector]![School] = [Forms]![Explorer School]![School] Attendance Sector being my forms data source table with field school being compared to the one on the form but it errors with [Attendance Sector] external name not defined. I...
  2. P

    VBA constant in sql is it only evaluated once?

    reply to banana Well banana it is currently hard coded but thats not very good programing practice as it is used in about 200 queries to perform error checking and validation on data (someone else wrote it). The number/actually a string is the academic year so 0607 last year 0708 this year it...
  3. P

    VBA constant in sql is it only evaluated once?

    Hi at the moment I am using a bit of VBA code like below: Public Const currentYear As String = "0708" Static Function GetCurrentYear() GetCurrentYear = currentYear End Function I then call this from my ms access sql statement with GetCurrentYear() am I correct in thinking this will only need...
  4. P

    How do I pass form object to VBA

    How do I pass the form object to VBA from an OnClick button action. I originaly had: (onclick event) =closeForm("the name of the from") then Public Function closeForm(formUsed As string) //do some data checking here DoCmd.Close acForm, formUsed End Function but I wish to change it to...
  5. P

    Transform Pivot query know fields

    I am working on a student register system, I am trying to modify someone else's existing access application and came across this: TRANSFORM First(absence_code) AS FirstOfabsence_code SELECT acad_period, student_id, register_id, register_group, First(absence_code) AS [Total Of absence_code] FROM...
  6. P

    Access sql replace statement null/empty strings

    Fixed It Myself Ok managed to fix it myself wrote a function: Public Function ReplaceNull(ByVal attendanceSingle As Variant) As Variant If IsNull(attendanceSingle) Then ReplaceNull = "-" Else ReplaceNull = attendanceSingle End If End Function called it from the sql as I would call replace
  7. P

    Access sql replace statement null/empty strings

    Im trying to concatenate a bunch of fields (50 arghh) which each are either blank or just contain one letter. This was someone elses setup for an attendance register which I think is an odd way of doing it. I would have used one field and then to get the mark for a week take a substring at the...
Back
Top Bottom