Search results

  1. K

    Runtime error 91

    I'd recommend adding a line near the beginning like: Dim J As Integer Won't guarantee it'll solve your problem, but it may be where Access is getting in a twist and even if not it's good practice to define your variables.
  2. K

    Whats wrong with my code? (Export query to Excel)

    Not sure if it will work, but try getting rid of the line "dbs.Close" at the end. You don't want to close dbs as it's the current database, you just want to empty the variable, which you do with the line "Set dbs = Nothing".
  3. K

    Help with the Append Query in VBA

    You do definitely need a semi-colon at the end. I've never tried concatenating in a table name before, but since you don't want it to come through as a string within the query I think that probably your existing code is correct except for the semi-colon, so the last part should be: & "];"
  4. K

    Quota control in a form

    Hmm, concerned that this line doesn't seem to work for you: Me.AllowAdditions = (rs!Male < 150 Or rs!Female < 110) It should mean that if either the quota of male students is less than 150 or the quote of female students is less than 110 then Me.AllowAdditions=True, otherwise it's False. An...
  5. K

    Total max of a line

    Shoot, normally Access plays nicely with calculated controls on reports when there's no other easy way to do it. There are then two options I can think of. 1) Bring Max(Special) into the query behind the report somehow. This may involve a new query that groups on the primary key of...
  6. K

    Total max of a line

    I think that if you put a text box with ControlSource: = Max([Special]) in either your Retailer Header or Retailer Footer and name it something like MaxOfSpecial, then you can sum this box in the Report Footer by having a text box with ControlSource: = Sum(MaxOfSpecial) The Max box can be...
  7. K

    Quota control in a form

    Oops, sorry about the typo in the code! I can't immediately see a problem with that line of code now. Just to check, the query from part (1) that you said works, what have you called that? Because the line should be: Set rs = CurrentDb.OpenRecordset("[the name of the query]") If that's not...
  8. K

    Quota control in a form

    1) You need a query. I'm guessing that StudentGender is a field against the Student and is set to something like "M" or "F", and that Status is also a field against the student, so you'd end up with something like: SELECT Sum(Iif(StudentGender="M",1,0)) AS Male, Sum(Iif(StudentGender="F",1,0)...
  9. K

    Reset Hyperlink on a button

    Let's work this through... You set up a button as a hyperlink. Once your user has clicked the button, you want to remove the hyperlink. Is this correct? Presumably if you set the hyperlink address to "" on the OnClick event, it changes it before the link is opened, yes? If so then maybe...
  10. K

    On Current Event on a Continous form

    Didn't know that, handy. Unfortunately not very useful for this problem, but definitely worth knowing.
  11. K

    On Current Event on a Continous form

    For a report, build the report based on your Jobs table. Use the Wizard. At the step that asks you if you want to add any grouping levels, choose StaffID to group on. Finish the Wizard. This should give you a report with sub headings of Staff (you can use a combo box bound to StaffID with the...
  12. K

    On Current Event on a Continous form

    Does it need to be a form? A report would be easier - you can either add grouping at the Staff level or have a subreport. Unfortunately you can't put subforms on continuous forms.
  13. K

    Keeping table headers on next page?

    The GroupHeader method I detailed will put the headings at the top of each group (under your Initiative headings) and at the top of each page. Page1 Initiative1 COLUMN1 COLUMN2 Rows Page2 COLUMN1 COLUMN2 Rows Initiative2 COLUMN1 COLUMN2 The Page/Report header method will put the headings...
  14. K

    On Current Event on a Continous form

    OK, time to go back a few steps and establish exactly what you're trying to do. It may be that a list box isn't the answer. So, questions: 1) What is this list box for? 2) Why does it need to be different for each row? 3) Does it need to show multiple items, or will it only show one item per...
  15. K

    On Current Event on a Continous form

    OK, I'm struggling myself now. I want to say that your SQL StaffID should equal your form StaffID, but I'm fairly sure that'll put you right back where you started. Give me a minute, I'll have a think!
  16. K

    Keeping table headers on next page?

    With your report open in Design view, go to View, Sorting and Grouping. Under Field/Expression choose the field you want to group on. In the bottom half of the screen set Group Header to Yes. Repeat to produce a second identical line. Close the Sorting and Grouping window. The select...
  17. K

    On Current Event on a Continous form

    Your SQL should now be the RowSource. The date parameters should be controls on a form (at a guess). By the way, I apologise if this doesn't work out right!
  18. K

    Keeping table headers on next page?

    So your first page information should be in the ReportHeader, which will appear before the PageHeader. ReportHeader: INFORMATION INFORMATION PageHeader: COLUMN1 COLUMN2 Detail: ROW INFO If you are in fact using grouping, then add another grouping level, but identical to your existing one...
  19. K

    On Current Event on a Continous form

    No, setting the RowSource won't solve this. It's the ControlSource that needs to be bound. So if your list values all link to the ID of your record, you would bind it to this (I think, it's difficult to worl out without seeing it).
  20. K

    On Current Event on a Continous form

    Actually Aje, even then the control is not showing different things simultaneously, you just can't see it on the other records to know that it's the same.
Back
Top Bottom