Search results

  1. S

    Open form only if a query returns a value

    Hi all, I have the following code: SELECT absent.id, absent.Name, absent.Days, absent.notes, absent.comments, absent.backtowork, absent.certification FROM absent WHERE (((absent.Name)=[forms]!frm_homepage.combo136.value) AND absent.backtowork = "No"); The above is in a query called...
  2. S

    dcount error

    perfect thanks :) great great help
  3. S

    dcount error

    excellent, first part working now to add this code: And [absentcode] = countme to the end - is this possible? countme is just text. it doesn't come from anywhere on the form.
  4. S

    dcount error

    cheers for all your help and this really annoying me now as im trying everything you say and more. this is the line at the moment: MsgBox DCount("[Name]", "absent", "[Name]" = '" & combo136.value & "'") but it errors at the first single quote, it wont let me finish the line...
  5. S

    dcount error

    this code returns 0 msgBox DCount("Name", "absent", "Name" = "combo136.value") combo136.value returns abbe i.e. the what ever name is in the combo136 field. when i run it without the name=combo then it returns 55. with it it returns 0
  6. S

    dcount error

    gemma, your mesgbox function worked fine, just got to figure out the rest of it now. any help would be great. cheers
  7. S

    dcount error

    i guess there isn't a way to encapsulate the word NAME just for this one line then when it is working i'll go through all the code over the weekend.?
  8. S

    dcount error

    ahhh, i think i catch your drift.
  9. S

    dcount error

    i have heard that before but i think im a bit to far in the programming to change the field name as it'll mess you some of the other coding
  10. S

    dcount error

    Bob, your code comes up with the error: you cancelled the previous operation. any ideas? thanks.
  11. S

    dcount error

    I have changed it to this: countme = "countme" namevalue = Combo136.Value LTotal3 = DCount("[Name]", "Absent", "Name = combo136.value" And "[absentcode] = countme ") and still the same any ideas? thanks for the # comment - I'll try to remember that for the rest of it - will come in...
  12. S

    dcount error

    I have the following piece of code: Dim countme As Variant Dim namevalue As Variant countme = "countme" namevalue = Combo136.Value LTotal3 = DCount("[Name]", "Absent", "[Name] = #" & namevalue & "#" And "[absentcode] = #" & countme & "#") could somebody please tell me why it comes up...
  13. S

    error in entering variables

    ok - I think it is reversing the dates. ergh. cheers for you help. I'll just make a note of it to enter the dates in the other way round. cheers
  14. S

    error in entering variables

    hi, many thanks for that. I now have the following code: strcondition = "[Start_Date] BETWEEN #" & Me.txtstartdate & "# AND #" & Me.txtEndDate & "#" DoCmd.OpenReport "absent2", acViewPreview, , strcondition but for some reason it still doesn't display anything in the report. Any...
  15. S

    error in entering variables

    Hi all I have the following code DoCmd.OpenReport "absent2", acViewPreview, , "Start_Date > [enter first date] and Start_Date < [enter last date]" How can I change [enter first date] and [enter last date] into preentered variables. i.e. adate = txtstartdate bdate = txtenddate then...
  16. S

    dcount or dsum or d?

    many thanks - thats helped a lot - think i have it sussed. cheers
  17. S

    dcount or dsum or d?

    cheers. I know the question isn't a simple one. I'll try to explain more clearly. I have an absent table with columns: Dayfoweek, nameofuser and daysoff. I would like either a query or command button to do this: when somebody chooses a name from the combo136 box they press the command...
  18. S

    dcount or dsum or d?

    ok many thanks - i'll change the day and name words. Just changing them now. but also any ideas on? in the absent table there is a column called Dayofweek and I want access to find all the occurances where combo136.value appears in the nameofuser field and 1 also appears in the daysoff column...
  19. S

    dcount or dsum or d?

    many thanks for your reply. I'll change that. But the main bit i am strugaling with is: in the absent table there is a column called Day (not days) and I want access (vba) to find all the occurances where combo136.value appears in the name field and 1 appears in the day column and where 1...
  20. S

    quick key violation error

    many thanks to all your answers. I used update and SET. my fault I know. thanks anyway
Back
Top Bottom