Search results

  1. L

    External name not defined error

    Hi, this is what I have right now. ption Compare Database Option Explicit public sub AssignWeekly([p3].[intake date] as Date) 'declares weekly column as a new variable Dim Client_Weekly_1213 As Integer 'starts coding in weekly If [p3].[intake date] >= #4/1/2012# And [p3].[intake date] <...
  2. L

    External name not defined error

    Hi, [P3] is the name of the table and the [Intake date] is a field in the [P3] table. This is not a form but a module. I went to VBA window and inserted a module and put the code in there. I could have put these codes in a query but there is apparently a limit to # of strings that Access can...
  3. L

    External name not defined error

    Hi there, I have a table onto which i would like to add new column based on a set of if statements. (to assign weekly dates) this is only a portion of the code, but when I clicked on run, it gives me "external name not defined error". Option Compare Database Option Explicit Public Sub...
  4. L

    Like operator, include fractions in result

    Hi there, I have the following query, which I simplied to show only the WHERE clouse. WHERE ((([Using our own appt date].PrblDiagCode) Like "519" Or ([Using our own appt date].PrblDiagCode)="414" Or ([Using our own appt date].PrblDiagCode)="428" Or ([Using our own appt...
  5. L

    rounding an average values

    Hi there, I'm trying to get this query to work: SELECT Avg(Round([Final 205].[LastOfSumOfRehLOS],2)) AS AvgInpLOS, Avg(Round([LastOfSumOfWaitLOS],1)) AS AvgWaitTime, Count([Final 205].PHN) AS Observations, [Final 205].LastOfIntensity AS Intensity_Level FROM [Final 205] GROUP BY [Final...
  6. L

    iifs query returns -1

    Hi there, I am writing some iif conditional statements in one of my tables to assign new values in that table. FP: IIf([cohort with status].[Intake Date] Between #04/01/2012# And #26/04/2012#,201201) Or IIf([cohort with status].[Intake Date] Between #27/04/2012# And #24/05/2012#,201202)...
  7. L

    simple SELECT CASE statement

    Hi there, I have a simple SELECT CASE query that I need help with. I'm not sure how the syntax goes and I want to learn about it. In the attached file, if you click on "cohort table", you will see the categorization for each unit under "field1". how will I be able to use a SELECT CASE...
  8. L

    aggregate functions with conditions

    Hi there, I have the following query. I got an error when I ran it. SELECT COUNT([encounter_number] WHERE status = 'Death')/ COUNT([encounter_number]) AS Death Ratio, tbl_test.facility_type AS Type, FROM tbl_test GROUP BY tbl_test.facility_type; I think the problem is that first WHERE...
  9. L

    Queries calulating ratio

    thanks, it works.
  10. L

    Queries calulating ratio

    Hi, I have a simple query like below. SELECT [score_admit] / SELECT [score_discharge] AS Ratio, facility_type FROM tbl_test group by facility_type; It's really just based on one table, but what I'm trying to do is to calculate the ratio for the scores, then arrange the result based on...
  11. L

    Representing a new measurement taken 2-4 hours after the initial measurement

    Hi there, How do I represent this logic in the query grid? col a is the first measurement and col b is the 2nd measurement What I want: Ones where the 2nd measurement is taken 2-4 hours after the initial measurement. what should the formula look like in col c...
  12. L

    Method or data member not found..

    Hello, can anyone help? I am stuck. The code is in Initial_Lactate_Result_Method_two_AfterUpdate() The logic is if the initial lactate by the 2nd method is >=4, then use this lactate to risk stratify. However, if the initial lactate by the 1st method is >=4, use this first method to risk...
  13. L

    Method or data member not found..

    Private Sub Initial_Lactate_Result_Method_One_AfterUpdate() If Me.Initial_Lactate_Result_Method_two < 4 Then If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP < 90 Then Me.Risk_Level.Value = 3 End If If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP >= 90 Then Me.Risk_Level.Value = 2...
  14. L

    Method or data member not found..

    Hi there, I have few lines of VBA code in access 2007, but it is not working as I keep getting "method or data member not found error whenever a field gets updated. logic is: If the initial lactate by method 2 is < 4 then use the initial lactate by method 1 to risk stratify. If the...
  15. L

    VBA not running in after update event. Run-time error '2113'

    Hi, I have a sample database set up in access 2007 and please see the attached. There is VBA code behind ED_disposition field in the after update event. When I change its value, I keep getting a run-time error "2113", saying the value you entered isn't valid for this field. I am not sure...
  16. L

    VBA code to bring up a calculator?

    Hi, I am not even sure if this is possible....but can you bring up a calculator through VBA or macro in access 2003 or 2007? Thank you
  17. L

    Rate calculation based on date range criterium

    Date is for specifying the number of records on each extract. data collection will be on-going, so for each reporting period we would like to have the analysis done and see what the percentage is like. So not possible? Thank you
  18. L

    Rate calculation based on date range criterium

    Hi, I have the following code working in Access: SELECT Count(regular_ct_scan_evidence) AS A, (select count(phn) from tbl_ed_data_collection_record) AS B, A/B AS Rate FROM tbl_ed_data_collection_record WHERE (tbl_ed_data_collection_record.Regular_CT_Scan_Evidence)="Yes"; If I want to add one...
  19. L

    form update event, but cannot proceed to next record

    I didn't get any syntax error from the code itself ,but the form just won't go to the next record.
  20. L

    form update event, but cannot proceed to next record

    Hi, I have this vba code written up in my main form, but when I click on go to next record button, the form won't respond. In the after update event of the form, I have: (I have attached the database as well) Private Sub Form_AfterUpdate() If Me.a.Value = "yes" And Me.b.Value = "Yes" And...
Back
Top Bottom